Skip to content

Commit 40ebf11

Browse files
AasthaSinha2305Violet-Bora-Lee
authored andcommitted
Date object explained clearly
1 parent 674ae7b commit 40ebf11

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

1-js/05-data-types/11-date/1-new-date/solution.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22

33
따라서 2월은 숫자 1을 사용해 만듭니다.
44

5+
Date object can be created in two formats:
6+
7+
1. new Date(year, month, date, hour, minute, second, millisecond)
8+
9+
```js run
10+
let d1 = new Date(2012, 1, 20, 3, 12);
11+
alert( d1 );
12+
```
13+
14+
2. new Date(datastring)
15+
516
```js run
6-
let d = new Date(2012, 1, 20, 3, 12);
7-
alert( d );
17+
let d2 = new Date("February 20, 2012 03:12:00");
18+
alert(d2);
819
```

0 commit comments

Comments
 (0)