[JavaScript] Date 객체


[JavaScript] Date 객체

Date 객체는 자바스크립트에서 날짜와 시간을 다루는 객체입니다. 사용자 브라우저의 타임존을 기준으로 날짜와 시간을 보여줍니다. 1. Date 생성자 Date 객체는 아래와 같이 생성할 수 있습니다. let now = new Date(); console.log(now); // Sat Oct 01 2022 09:16:53 GMT+0900 let date = new Date(2022, 5 - 1, 24, 10, 33, 30); // 월은 0부터 시작 console.log(date); // Tue May 24 2022 10:33:30 GMT+0900 console.log(new Date(0)); // Thu Jan 01 1970 09:00:00 GMT+0900 console.log(new Date(0 + 100000000000)); // Sat Mar 03 1973 18:46:40 GMT+0900 2. Set / Get 함수 Date 객체에 내장되어 있는 Set / Get 함수는 다음과 ...


#date #javascript #자바스크립트

원문링크 : [JavaScript] Date 객체