Data对象

var myDate = new Date();

Date()返回当日的日期

例如今天是2016/8/19

getFullYear()返回当前日期的年

myDate.getFullYear()

2016

getDate()返回当前日期的日

myDate.getDate()
19

getDay()返回一周中的某一天
myDate.getDay()
5

getMonth()取值范围是0~11,如果显示当前月的话getMonth()+1
myDate.getMonth()
7

getTime() 返回 1970 年 1 月 1 日至今的毫秒数。

valueof()返回值Data的毫秒数同Data.getTime返回值相同。

 

posted @ 2016-08-22 14:48  xuxuan  阅读(168)  评论(0编辑  收藏  举报