Temporal.Now.plainDateISO()
Baseline Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The Temporal.Now.plainDateISO() static method returns the current date as a Temporal.PlainDate object, in the ISO 8601 calendar and the specified time zone.
Syntax
Temporal.Now.plainDateISO() Temporal.Now.plainDateISO(timeZone)
Parameters
-
timeZoneOptional - Either a string or a
Temporal.ZonedDateTimeinstance representing the time zone to interpret the system time in. If aTemporal.ZonedDateTimeinstance, its time zone is used. If a string, it can be a named time zone identifier, an offset time zone identifier, or a date-time string containing a time zone identifier or an offset (see time zones and offsets for more information).
Return value
The current date in the specified time zone, as a Temporal.PlainDate object using the ISO 8601 calendar.
Exceptions
-
RangeError - Thrown if the time zone is invalid.
Examples
Using Temporal.Now.plainDateISO()
// The current date in the system's time zone
const date = Temporal.Now.plainDateISO();
console.log(date); // e.g.: 2021-10-01
// The current date in the "America/New_York" time zone
const dateInNewYork = Temporal.Now.plainDateISO("America/New_York");
console.log(dateInNewYork); // e.g.: 2021-09-30
Specifications
| Specification |
|---|
| Temporal # sec-temporal.now.plaindateiso |
Browser compatibility
| Desktop | Mobile | Server | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on iOS | Samsung Internet | WebView Android | WebView on iOS | Bun | Deno | Node.js | |
plainDateISO |
144 |
144 |
139 |
128 |
preview |
144 |
139 |
95 |
No |
No |
144 |
No |
1.4.0 |
2.7 |
26.0.0 |
See also
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Now/plainDateISO