File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,33 @@ ECMAScript 提供了很多原生引用类型。
66
77### 1、Date类型
88
9+ ECMAScript 中的 Date 类型是在早期 Java 中的 java.util.Date 类基础上构建的。为此,Date 类型使用自 UTC(国际协调时间)1970年1月1日午夜(零时)开始经过的毫秒数来保存日期。
10+ 要创建一个对象,使用 new 操作符和 Date 构造函数即可,如下:
11+
12+ ` var now = new Date(); `
13+
14+ #### 日期/时间组件方法
15+
16+ | 方法 | 说明 |
17+ | :-: | :-: |
18+ | getTime() | 返回表示日期的毫秒数;与valueOf()方法返回的值相同 |
19+ | setTime(毫秒) | 以毫秒数设置日期,会改变整个日期 |
20+ | getFullYear() | 获取4位数的年份如:2018 |
21+ | getMouth() | 获取日期中的月份,0表示一月,11表示十二月 |
22+ | getDate() | 获取日期月份中的天数(1~31) |
23+ | getDay() | 获取日期中的星期几(0表示星期日,6表示星期6) |
24+ | getHours() | 获取日期中的小时数(0~23) |
25+ | getMinutes() | 获取日期中的分钟数(0~59) |
26+ | getSeconds() | 获取日期中的秒数(0~59) |
27+ | getMilliseconds() | 获取日期中的毫秒数 |
28+
29+
30+
931### 2、RegExp类型
1032
1133### 3、Function类型
1234
1335### 4、基本包装类型
1436
15- ### 5、单体内置对象
37+ ### 5、单体内置对象
38+
You can’t perform that action at this time.
0 commit comments