Date 개체는 JavaScript 언어에 내장된 데이터 유형입니다. 날짜 객체는 아래와 같이 new Date( )로 생성됩니다 -
new Date( ) new Date(milliseconds) new Date(datestring) new Date(year,month,date[,hour,minute,second,millisecond ])
예시
다음 코드를 실행하여 JavaScript에서 Date 개체를 구현할 수 있습니다.
<html>
<head>
<title>JavaScript Dates</title>
</head>
<body>
<script>
var date = new Date();
document.write("dt.constructor is : " + date.constructor);
</script>
</body>
</html> 출력
dt.constructor is : function Date() { [native code] }