javascript Date对象 js全部的 时间属性 和 方法

 1 Date()    返回当日的日期和时间。
 2 
 3 getTime()    返回 1970 年 1 月 1 日至今的毫秒数。
 4 
 5 getDate()    从 Date 对象返回一个月中的某一天 (1 ~ 31)。天
 6 getDay()    从 Date 对象返回一周中的某一天 (0 ~ 6)。 星期
 7 getMonth()    从 Date 对象返回月份 (0 ~ 11)。        月
 8 getFullYear()    从 Date 对象以四位数字返回年份。 年
 9 getYear()    请使用 getFullYear() 方法代替。
10 
11 getHours()    返回 Date 对象的小时 (0 ~ 23)。
12 getMinutes()    返回 Date 对象的分钟 (0 ~ 59)。
13 getSeconds()    返回 Date 对象的秒数 (0 ~ 59)。
14 getMilliseconds()    返回 Date 对象的毫秒(0 ~ 999)。
15 
16 
17 getTimezoneOffset()    返回本地时间与格林威治标准时间 (GMT) 的分钟差。
18 getUTCDate()    根据世界时从 Date 对象返回月中的一天 (1 ~ 31)。
19 getUTCDay()    根据世界时从 Date 对象返回周中的一天 (0 ~ 6)。
20 getUTCMonth()    根据世界时从 Date 对象返回月份 (0 ~ 11)。
21 getUTCFullYear()    根据世界时从 Date 对象返回四位数的年份。
22 
23 getUTCHours()    根据世界时返回 Date 对象的小时 (0 ~ 23)。
24 getUTCMinutes()    根据世界时返回 Date 对象的分钟 (0 ~ 59)。
25 getUTCSeconds()    根据世界时返回 Date 对象的秒钟 (0 ~ 59)。
26 getUTCMilliseconds()    根据世界时返回 Date 对象的毫秒(0 ~ 999)。
27 parse()    返回1970年1月1日午夜到指定日期(字符串)的毫秒数。
28 
29 setDate()    设置 Date 对象中月的某一天 (1 ~ 31)。
30 setMonth()    设置 Date 对象中月份 (0 ~ 11)。
31 setFullYear()    设置 Date 对象中的年份(四位数字)。
32 setYear()    请使用 setFullYear() 方法代替。
33 setHours()    设置 Date 对象中的小时 (0 ~ 23)。
34 setMinutes()    设置 Date 对象中的分钟 (0 ~ 59)。
35 setSeconds()    设置 Date 对象中的秒钟 (0 ~ 59)。
36 setMilliseconds()    设置 Date 对象中的毫秒 (0 ~ 999)。
37 setTime()    以毫秒设置 Date 对象。
38 setUTCDate()    根据世界时设置 Date 对象中月份的一天 (1 ~ 31)。
39 setUTCMonth()    根据世界时设置 Date 对象中的月份 (0 ~ 11)。
40 setUTCFullYear()    根据世界时设置 Date 对象中的年份(四位数字)。
41 setUTCHours()    根据世界时设置 Date 对象中的小时 (0 ~ 23)。
42 setUTCMinutes()    根据世界时设置 Date 对象中的分钟 (0 ~ 59)。
43 setUTCSeconds()    根据世界时设置 Date 对象中的秒钟 (0 ~ 59)。
44 setUTCMilliseconds()    根据世界时设置 Date 对象中的毫秒 (0 ~ 999)。
45 toSource()    返回该对象的源代码。
46 toString()    把 Date 对象转换为字符串。
47 toTimeString()    把 Date 对象的时间部分转换为字符串。
48 toDateString()    把 Date 对象的日期部分转换为字符串。
49 toGMTString()    请使用 toUTCString() 方法代替。
50 toUTCString()    根据世界时,把 Date 对象转换为字符串。
51 toLocaleString()    根据本地时间格式,把 Date 对象转换为字符串。
52 toLocaleTimeString()    根据本地时间格式,把 Date 对象的时间部分转换为字符串。
53 toLocaleDateString()    根据本地时间格式,把 Date 对象的日期部分转换为字符串。
54 UTC()    根据世界时返回 1970 年 1 月 1 日 到指定日期的毫秒数。
55 valueOf()    返回 Date 对象的原始值

 

posted @ 2020-02-16 19:48  鸡儿er  阅读(316)  评论(0编辑  收藏  举报