Temporal PlainDateTime
Temporal.PlainDateTime Object Reference
The temporal.PlainDateTime object is a date and time object.
It represents a calendar date and a wall-clock time with no time zone.
Example: 2026-05-07T14:30:00.
Temporal.PlainDateTime Methods
Revised March 2026
| Constructing | Description |
|---|---|
| from() | Creates a PlainDateTime object from an object or a string |
| new | Creates a PlainDateTime object from parameters |
| Arithmetic | |
| add() | Returns a PlainDateTime with a duration added |
| subtract() | Returns a PlainDateTime with a duration subtracted |
| round() | Returns a PlainDateTime rounded to a given unit |
| Comparing | |
| compare() | Returns -1, 0, or 1 from comparing two dates |
| equals() | Returns true if two PlainDateTime objects are identical |
| since() | Returns the difference from another PlainDateTime |
| until() | Returns the difference until another PlainDateTime |
| Converting | |
| toPlainDate() | Returns a PlainDate object with the date from this PlainDateTime |
| toPlainTime() | Returns a PlainTime object with the time from this PlainDateTime |
| toZonedDateTime() | Returns a ZonedDatetime object with this PlainDateTime in a time zone |
| with() | Returns a PlainDateTime with specified fields modified |
| withCalendar() | Returns a PlainDateTime with a different calendar system |
| withPlainTime() | Returns a PlainDateTime with the time part replaced by a new time |
| Formatting | |
| toJSON() | Returns an RFC 9557 format string for JSON serialization |
| toLocaleString() | Returns a language-sensitive representation of the date |
| toString() | Returns an RFC 9557 format string representation of the date |
| valueOf() | Throws an error to prevents temporals from being converted to primitives |
Temporal.PlainDateTime Properties
The Temporal.PlainDateTime object has 22 properties of calendar date information.
| Property | Description |
|---|---|
| calendarId | Calendar system identifier ("iso8601") |
| day | The day as an integer (1-31) |
| dayOfWeek | The day of the week as an integer (1 = Monday) |
| dayOfYear | The ordinal day of the year |
| daysInMonth | The total number of days in that month |
| daysInWeek | The total number of days in that week |
| daysInYear | The total number of days in that year |
| era | The era name of the calendar, if applicable |
| eraYear | The year within the era, if applicable |
| hour | The hour as an integer (0-23) |
| inLeapYear | A boolean indicating if the date falls in a leap year |
| microsecond | The microsecond as an integer (0-999) |
| millisecond | The millisecond as an integer (0-999) |
| minute | The minute as an integer (0-59) |
| month | The month as an integer (1-12) |
| monthCode | A calendar-specific string code for the month ("M01") |
| monthsInYear | The total number of months in that year |
| nanosecond | The nanosecond as an integer (0-999) |
| second | The second as an integer (0-59) |
| weekOfYear | The week number within the year |
| year | The year as an integer |
| yearOfWeek | The year that the week belongs to |
Browser Support
Temporal is a major update to the JavaScript standard (TC39).
It is currently supported in Chrome, Edge, Firefox, and Opera Safari has not shipped it yet.
| Chrome 144 |
Edge 144 |
Firefox 139 |
Safari |
Opera 128 |
| Jan 2026 | Jan 2026 | May 2025 | 🚫 | Feb 2026 |
The Safari implementation can be tested in Safari Technology Preview by enabling the --use-temporal runtime flag.
Polyfill
Until Safari supports Temporal natively, you can use the official polyfill:
<script
src="https://cdn.jsdelivr.net/npm/@js-temporal/polyfill@0.5.1/dist/index.umd.js">
</script>