| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ru/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 ..
* Some parts of this feature may have varying levels of support.
Date JavaScript . Date , (00:00:00 UTC) 1 1970 ( Unix).
new Date(); new Date(value); new Date(dateString); new Date(year, month[, day[, hour[, minute[, second[, millisecond]]]]]);
:
Date Date : ( , new) Date; JavaScript, Date .
:
Date , , , (, 13 70 ) . , new Date(2013, 13, 1) new Date(2014, 1, 1), 2014-02-01 ( ). : new Date(2013, 2, 1, 0, 70) new Date(2013, 2, 1, 1, 10) 2013-03-01T01:10:00.
:
Date , . UTC, new Date( .Date.UTC(...))
value, , 1 1970 00:00:00 UTC ( Unix).
dateString , . , Date.parse() ( IETF RFC 2822 [ , ], ISO8601 [ , ]).
yearmonth, , 0 11 .
day. , .
hour. , .
minute. , .
second. , .
millisecond. , .
Date , .Date -100 000 000 100 000 000 1 1970 UTC.Date . , , .Date UTC ( ), . UTC, (GMT), , . , JavaScript.Date ( , new) , .Date.now(), , 1 1970 00:00:00 UTC.
Date.parse()1 1970 00:00:00 .
Date.UTC(), ( , 2 7) , 1 1970 00:00:00 UTC.
Date.prototype Date.
Date.prototype.constructor-, . Date Date.
DateJavaScript:
:
Date ( Date.parse) .
var today = new Date();
var birthday = new Date("December 17, 1995 03:24:00");
var birthday = new Date("1995-12-17T03:24:00");
var birthday = new Date(1995, 11, 17);
var birthday = new Date(1995, 11, 17, 3, 24, 0);
, 0 99 , Date.prototype.setFullYear() Date.prototype.getFullYear().
var date = new Date(98, 1); // Sun Feb 01 1998 00:00:00 GMT+0000 (GMT)
// , 98 1998
date.setYear(98); // Sun Feb 01 1998 00:00:00 GMT+0000 (GMT)
date.setFullYear(98); // Sat Feb 01 0098 00:00:00 GMT+0000 (BST)
, JavaScript:
// Date
var start = Date.now();
// , , :
doSomethingForALongTime();
var end = Date.now();
var elapsed = end - start; //
//
var start = new Date();
// , , :
doSomethingForALongTime();
var end = new Date();
var elapsed = end.getTime() - start.getTime(); //
//
function printElapsedTime(fTest) {
var nStartTime = Date.now(),
vReturn = fTest(),
nEndTime = Date.now();
console.log(
" : " + String(nEndTime - nStartTime) + " ",
);
return vReturn;
}
yourFunctionReturn = printElapsedTime(yourFunction);
:
, API , Performance.now() , Date.now().
var seconds = Math.floor(Date.now() / 1000);
( ), ( Math.floor() Math.round()).
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-date-objects |
This page was last modified on 29 . 2026 . 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()[Symbol.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 |