728x90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const date1 = new Date(Date.UTC(2012,1,20,3,12)); // GMT +09:00 | |
console.log(new Date(date1)); | |
const date2 = new Date('February 20, 2012 03:12:00 GMT'); // GMT +09:00 | |
console.log(date2); | |
const date3 = new Date(2012,1,20,3,12); // UTC | |
console.log(date3); | |
const date4 = new Date('February 20, 2012 03:12:00'); // UTC | |
console.log(date4); |
'Algorithm > JavaScript(Node.js)' 카테고리의 다른 글
The Modern JS Tutorial: Date and Time: European weekday (0) | 2021.11.29 |
---|---|
The Modern JS Tutorial: Date and Time: show a weekday (0) | 2021.11.17 |
The Modern JS Tutorial: Destructuring Assignment: The maximal salary (0) | 2021.10.25 |
The Modern JS Tutorial: Destructuring Assignment: destructuring assignment (0) | 2021.10.25 |
The Modern JS Tutorial: WeakMap and WeakSet: store read dates (0) | 2021.10.20 |