new Date() ->当前系统的时间对象 getFullYear()、getYear()、getUTCFullYear() getYear(),2000年之后返回1XX,例如:2014年返回114(不推荐使用) getFullYear(),返回4位数,例如:2014年返回2014 getUTCFullYear(),返回UTC的年份,也是四位数 getMonth() 返回0-11,0代表一月,因此返回正确的月份,需要getMonth()+1; getDate() getDay() getHours() getMinutes() getSeconds()
new Date() 数字形式:new Date(2014,0,21,22,17,01); 字符串: new Date(‘January 21,2014 22:17:01‘) 月份:January、February、March、April、May、June July、August、September、October、November、December 时间转换公式 t = Math.floor((未来的时间-当前的时间)/1000) 秒 天:Math.floor(t/86400) 时:Math.floor(t%86400/3600) 分:Math.floor(t%86400%3600/60) 秒:t%60 时间戳:getTime() 返回从1970年1月1日0点0分0秒0毫秒
[妙味JS基础]第十课:日期对象、时钟倒计时,布布扣,bubuko.com
原文:http://www.cnblogs.com/joya0411/p/3580953.html