✔️ 자바스크립트의 날짜와 시간은 내장된 Date 객체에서 담당.
Date 객체는 원래 자바에서 가져온 것.
('자바'스크립트가 자바와 연관된 몇 안 되는 부분 중 하나)
현재 날짜와 시간을 나타내는 객체를 만들 때는 new Date()를 사용.
const now = new Date();
now; // Fri Dec 16 2020 09:20:16 GMT +0900 (KST)
const halloween = new Date(2020, 9, 31); // 월은 0에서 시작. 9 ➜ 10.
const halloweenParty = new Date(2020, 9, 31, 19, 0); // 19:00 = 7:00 pm
halloweenParty.getFullYear(); // 2021
halloweenParty.getMonth(); // 5
halloweenParty.getDate(); // 8
halloweenParty.getDay(); // 2 (1: 월요일, 0: 일요일)
halloweenParty.getHours(); // 12
halloweenParty.getMinutes(); // 0
halloweenParty.getSeconds(); // 0
halloweenParty.getMillisecounds(); // 0