当前系统的时间对象:new Date()
时间对象有:
getFullYear(); 年
getMonth()+1; 月
getDate(); 日
getDay(); 星期
getHours(); 小时
getMinutes(); 分钟
getSeconds(); 秒
str = iYear+ ‘年’ +iMonth+‘月’+iDate+'日 ‘+iWeek+’ ‘+ iHours+’ : ‘+ iMin+’ : '+ iSec;
倒计时时间 :都是毫秒计算的所以要除以1000
现在 and 未来
未来两种写发:
1.字符串 : new Date( ‘November 27,2013 22:3:0’ );
2.数字 :new Date( 2013, 10, 27, 21,56,0 );
天、时、分、秒的计算
天:Math.floor(t/86400)
时:Math.floor(t%86400/3600)
分:Math.floor(t%86400%3600/60)
秒:t%60
str = Math.floor(t/86400)+‘天’+Math.floor(t%86400/3600)+‘时’+Math.floor(t%86400%3600/60)+‘分’+t%60+‘秒’;