JS之date对象

134 阅读1分钟
1.Date() 返回当日的日期和时间。

 2.getDate() 从 Date 对象返回一个月中的某一天 (1 ~ 31)。 

3.getDay() 从 Date 对象返回一周中的某一天 (0 ~ 6)。 

4.getMonth() 从 Date 对象返回月份 (0 ~ 11)。

 5.getFullYear() 从 Date 对象以四位数字返回年份。 

6.getHours() 返回 Date 对象的小时 (0 ~ 23)。 

7.getMinutes() 返回 Date 对象的分钟 (0 ~ 59)。 

8.getSeconds() 返回 Date 对象的秒数 (0 ~ 59)。

 9.getMilliseconds() 返回 Date 对象的毫秒(0 ~ 999)。 

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

11. setDate 设置一个月的某一天