== JS-9-1日期时间函数 ==

 

 

 

 

 

--- 日期和时间函数 ---

 

var d = new Date()

d.getFullYear()
d.getMonth()
d.getDate()
d.getDay()
d.getHours()
d.getMinutes()
d.getSeconds()


封装日期时间函数:

 

图片时钟:
将文字变成图片
str.charAt()

 


倒计时: 毫秒换算

毫秒到秒: t = Math.floor(t/1000);
天: Math.floor(t/86400)
时: Math.floor(t%86400/3600)
分: Math.floor(t%86400/3600/60)
秒: t%60

 

 

 

 

 

 

posted @ 2018-08-06 16:57  silvercell  阅读(1162)  评论(0)    收藏  举报