摘要: var myDate = new Date(); myDate.getYear(); //获取当前年份(2位) myDate.getFullYear(); //获取完整的年份(4位,1970-????) myDate.getMonth(); //获取当前月份(0-11,0代表1月) myDate.getDate(); //获取当前日(1-31) myDate.getDay(); //获取当前星期X(0-6,0代表星期天) myDate.getTime(); ... 阅读全文
posted @ 2013-10-16 14:02 程序员-初学者 阅读(1291) 评论(0) 推荐(0) 编辑
摘要: 1 //扩展Date的format方法 2 Date.prototype.format = function (format) { 3 var o = { 4 "M+": this.getMonth() + 1, 5 "d+": this.getDate(), 6 "h+": this.getHours(), 7 "m+": this.getMinutes(), 8 "s+": this.getSeconds(), 9 "q+": Math.floor((this.getMo 阅读全文
posted @ 2013-10-16 13:55 程序员-初学者 阅读(393) 评论(0) 推荐(0) 编辑