| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Date | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.
* Some parts of this feature may have varying levels of support.
JavaScript Date .
Date 1970 1 1 UTC( ) .
JavaScript 1970 1 1 UTC , UNIX (UNIX epoch, 1970 1 1 ) .
:
Date UTC ,
( ) .
Date JavaScript .
(Number.MAX_SAFE_INTEGER 9,007,199,254,740,991.) , ECMA-262 1970 1 1 UTC
100,000,000(1) Date . 271821 4 20
275760 9 13 , 8,640,000,000,000,000 .
, (UTC) . (UTC , .) .
getDay() setHours()
getUTCDay() setUTCHours()
UTC / .
Date() new Date().toString() .
new Date() Date .
Date.now()1970 1 1 00:00:00 UTC . .
Date.parse(), 1970 1 1 00:00:00 UTC .
:
Date.parse()
.
Date.UTC()( , 2 ~ 7) , 1970 1 1 00:00:00 UTC . .
Date.prototype.getDate()Date (131) .
Date.prototype.getDay()Date (06) .
Date.prototype.getFullYear()Date ( ) .
Date.prototype.getHours()Date (023) .
Date.prototype.getMilliseconds()Date (0999) .
Date.prototype.getMinutes()Date (059) .
Date.prototype.getMonth()Date (011) .
Date.prototype.getSeconds()Date (059) .
Date.prototype.getTime()1970 1 1 00:00:00 UTC . Date
.
Date.prototype.getTimezoneOffset()UTC .
Date.prototype.getUTCDate()Date (131) .
Date.prototype.getUTCDay()Date (06) .
Date.prototype.getUTCFullYear()Date ( ) .
Date.prototype.getUTCHours()Date (023) .
Date.prototype.getUTCMilliseconds()Date (0999) .
Date.prototype.getUTCMinutes()Date (059) .
Date.prototype.getUTCMonth()Date (011) .
Date.prototype.getUTCSeconds()Date (059) .
Date.prototype.setDate().
Date.prototype.setFullYear()( ) .
Date.prototype.setHours().
Date.prototype.setMilliseconds().
Date.prototype.setMinutes().
Date.prototype.setMonth().
Date.prototype.setSeconds().
Date.prototype.setTime()Date 1970 1 1 00:00:00 UTC () . .
Date.prototype.setUTCDate().
Date.prototype.setUTCFullYear()( ) .
Date.prototype.setUTCHours().
Date.prototype.setUTCMilliseconds().
Date.prototype.setUTCMinutes().
Date.prototype.setUTCMonth().
Date.prototype.setUTCSeconds().
Date.prototype.toDateString()Date , .
Date.prototype.toISOString()Date ISO 8601 .
Date.prototype.toJSON()Date.prototype.toLocaleDateString()Date .
Date.prototype.toLocaleFormat() Date .
Date.prototype.toLocaleString()Date .
Object.prototype.toLocaleString() .
Date.prototype.toLocaleTimeString()Date .
Date.prototype.toString()Date . Object.prototype.toString()
.
Date.prototype.toTimeString()Date , .
Date.prototype.toUTCString()Date UTC .
Date.prototype.valueOf()JavaScript .
:
Date ( Date.parse())
.
let today = new Date();
let birthday = new Date("December 17, 1995 03:24:00");
let birthday = new Date("1995-12-17T03:24:00");
let birthday = new Date(1995, 11, 17); // 0
let birthday = new Date(1995, 11, 17, 3, 24, 0);
Date 0 99 1900
1999 . .
1900 , 0 ~ 99 Date.prototype.setFullYear()
Date.prototype.getFullYear() .
let date = new Date(98, 1); // Sun Feb 01 1998 00:00:00 GMT+0900 ( )
// : 98 1998
date.setYear(98); // Sun Feb 01 1998 00:00:00 GMT+0900 ( )
date.setFullYear(98); // Sat Feb 01 0098 00:00:00 GMT+0827 ( )
JavaScript .
, , () , // .
// Date
let start = Date.now();
//
doSomethingForALongTime();
let end = Date.now();
let elapsed = end - start; //
//
let start = new Date();
//
doSomethingForALongTime();
let end = new Date();
let elapsed = end.getTime() - start.getTime(); //
// ,
function printElapsedTime(fTest) {
let nStartTime = Date.now(),
vReturn = fTest(),
nEndTime = Date.now();
console.log(`Elapsed time: ${String(nEndTime - nStartTime)} milliseconds`);
return vReturn;
}
let yourFunctionReturn = printElapsedTime(yourFunction);
let seconds = Math.floor(Date.now() / 1000);
, . ""
Math.round() Math.floor() .
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-date-objects |
This page was last modified on 2025 10 9 by MDN contributors.
DateDate.prototype.getDate()Date.prototype.getDay()Date.prototype.getFullYear()Date.prototype.getHours()Date.prototype.getMilliseconds()Date.prototype.getMinutes()Date.prototype.getMonth()Date.prototype.getSeconds()Date.prototype.getTime()Date.prototype.getTimezoneOffset()Date.prototype.getUTCDate()Date.prototype.getUTCDay()Date.prototype.getUTCFullYear()Date.prototype.getUTCHours()Date.prototype.getUTCMilliseconds()Date.prototype.getUTCMinutes()Date.prototype.getUTCMonth()Date.prototype.getUTCSeconds()Date.prototype.getYear()Date.prototype.setDate()Date.prototype.setFullYear()Date.prototype.setHours()Date.prototype.setMilliseconds()Date.prototype.setMinutes()Date.prototype.setMonth()Date.prototype.setSeconds()Date.prototype.setTime()Date.prototype.setUTCDate()Date.prototype.setUTCFullYear()Date.prototype.setUTCHours()Date.prototype.setUTCMilliseconds()Date.prototype.setUTCMinutes()Date.prototype.setUTCMonth()Date.prototype.setUTCSeconds()Date.prototype.setYear()Date.prototype.toDateString()Date.prototype.toISOString()Date.prototype.toJSON()Date.prototype.toLocaleDateString()Date.prototype.toLocaleString()Date.prototype.toLocaleTimeString()Date.prototype.toString()toTemporalInstant()Date.prototype.toTimeString()Date.prototype.toUTCString()Date.prototype.valueOf()Date.prototype[@@toPrimitive]Object/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |