点石成金

勤能补拙

导航

2012年4月26日

js中格式化时间字符串

摘要: 在javascript中,关于时间格式的转换。 可以将“2010-1-2” 转换为 “2010-01-02 00:00:00” 或者将“2010-1-2 2:13:6" 转换为 “2010-01-02 02:13:06” 第一种格式转换 1.<script> 2.umber.prototype.pad2 =function(){ 3. return this>9?this:'0'+this; 4. } 5. Date.prototype.format=function (format) { 6. ... 阅读全文

posted @ 2012-04-26 11:22 90后、程序猿 阅读(23965) 评论(1) 推荐(1) 编辑