1. 자바스크립트 - Date(내장객체)
-date는 윈도우에 있는 내장객체이다.
getFullYear() :년도 4 자리
getMonth() : 월 (0~11) - 0: 1월, 11: 12월
getDate() : 일
getDay () : 요일(0:일, 1:월, ...., 6:토)
getHours() :시간
getMinutes() :분
getSeconds() :초
getMilliseconds() :밀리초(1/1000 초)
getTime() :1970년 1월 1일 부터 경과시간(밀리초 기준)
-Date 객체를 생성하는 방법 4가지
new Date ();
new Date(milliseconds);
new Date(datestring); datestring : "2021/09/10 17:36:10";
new Date (year, month, date, hours, minutes, seconds, milliseconds);



'JavaScript' 카테고리의 다른 글
20 - 자바스크립트 - Array (0) | 2021.09.13 |
---|---|
19 - 자바스크립트 - Math (0) | 2021.09.13 |
17 - 자바스크립트 - object (0) | 2021.09.12 |
16 - 자바스크립트 - var , let, const 정리 (0) | 2021.09.12 |
15 - 자바스크립트 -익명함수, 자동실행 함수, 콜백함수 (0) | 2021.09.12 |