coderef

DateBaseline · Widely available

The Date object represents a single moment in time.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 29, 2015. Widely available since Jan 29, 2018.

Browser support

DesktopChrome
1+Supportedsince Dec 11, 2008
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1+Supportedsince Nov 9, 2004
Current: 157
Safari
1+Supportedsince Jun 23, 2003
Current: 27
MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155
Firefox Android
4+Supportedsince Mar 29, 2011
Current: 157
Safari iOS
1+Supportedsince Jun 29, 2007
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: Date.

Feature detection

JS · check before using
if (typeof Date !== "undefined") {
  // Date is available
}

Sub-features

Support for each part of the feature (48). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Date112111841
Date.@@toPrimitive47154410474410
Date.Date112111841
Date.UTC112111841
Date.UTC.optional_monthIndex≤15≤15≤4≤10.1184≤10.3
Date.getDate112111841
Date.getDay112111841
Date.getFullYear112111841
Date.getHours112111841
Date.getMilliseconds112111841
Date.getMinutes112111841
Date.getMonth112111841
Date.getSeconds112111841
Date.getTime112111841
Date.getTimezoneOffset112111841
Date.getUTCDate112111841
Date.getUTCDay112111841
Date.getUTCFullYear112111841
Date.getUTCHours112111841
Date.getUTCMilliseconds112111841
Show 28 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Date.getUTCMinutes112111841
Date.getUTCMonth112111841
Date.getUTCSeconds112111841
Date.now112141844
Date.parse112111841
Date.parse.iso_860161245.11845
Date.setDate112111841
Date.setFullYear112111841
Date.setHours112111841
Date.setMilliseconds112111841
Date.setMinutes112111841
Date.setMonth112111841
Date.setSeconds112111841
Date.setTime112111841
Date.setUTCDate112111841
Date.setUTCFullYear112111841
Date.setUTCHours112111841
Date.setUTCMilliseconds112111841
Date.setUTCMinutes112111841
Date.setUTCMonth112111841
Date.setUTCSeconds112111841
Date.toDateString112111841
Date.toISOString312141843.2
Date.toJSON312141843.2
Date.toString112111841
Date.toTimeString112111841
Date.toUTCString112111841
Date.valueOf112111841