ZonedDateTime
The Temporal.ZonedDateTime object represents an exact time, including a time zone and calendar.
Fields
- _inner:*abi.c.ZonedDateTime
- *abi.c.ZonedDateTime
Types
- TimeZone
Represents a time zone, identified by an IANA time zone identifier or a fixed offset.
- Disambiguation
Disambiguation options for resolving ambiguous local times (e.g., during DST transitions).
- OffsetDisambiguation
Options for resolving offset ambiguity when parsing ZonedDateTime from a string.
- CalendarDisplay
Controls how the calendar is displayed in string output.
- DisplayOffset
Controls how the offset is displayed in string output.
- DisplayTimeZone
Controls how the time zone is displayed in string output.
- ToStringOptions
Options for formatting ZonedDateTime as a string.
- WithOptions
Options for
with()method.
Functions
- init
Creates a new ZonedDateTime from the given epoch nanoseconds and time zone.
- fromEpochMilliseconds
Creates a new ZonedDateTime from the given epoch milliseconds and time zone.
- fromEpochNanoseconds
Creates a new ZonedDateTime from the given epoch nanoseconds and time zone.
- from
Parses a ZonedDateTime from a string, with optional disambiguation and offset options.
- compare
Compares two ZonedDateTime instances by their instant values.
- add
Returns a new ZonedDateTime moved forward by the given duration.
- equals
Returns true if this ZonedDateTime is equal to another (same instant, time zone, and calendar).
- getTimeZoneTransition
Returns the first instant after or before this instant at which the time zone's UTC offset changes, or null if none.
- round
Returns a new ZonedDateTime rounded to the given unit and options.
- since
Returns the duration from another ZonedDateTime to this one.
- startOfDay
Returns a ZonedDateTime representing the start of the day in the time zone.
- subtract
Returns a new ZonedDateTime moved backward by the given duration.
- toInstant
Returns a new Instant representing the same instant as this ZonedDateTime.
- toJSON
Returns a string representing this ZonedDateTime in RFC 9557 format (ISO 8601 with time zone).
- toLocaleString
Returns a language-sensitive string representation of this ZonedDateTime.
- toPlainDate
Returns a PlainDate representing the date portion of this ZonedDateTime.
- toPlainDateTime
Returns a PlainDateTime representing the date and time portions of this ZonedDateTime.
- toPlainTime
Returns a PlainTime representing the time portion of this ZonedDateTime.
- toString
Returns a string representing this ZonedDateTime in RFC 9557 format, with options for formatting.
- until
Returns the duration from this ZonedDateTime to another.
- valueOf
Throws an error; valueOf() is not supported for ZonedDateTime.
- with
Returns a new ZonedDateTime with some fields replaced by new values.
- withCalendar
Returns a new ZonedDateTime interpreted in the new calendar system.
- withPlainTime
Returns a new ZonedDateTime with the time part replaced by the new time.
- withTimeZone
Returns a new ZonedDateTime representing the same instant in a new time zone.
- calendarId
Returns the calendar identifier used to interpret the internal ISO 8601 date.
- day
Returns the 1-based day index in the month of this date.
- dayOfWeek
Returns the 1-based day index in the week of this date.
- dayOfYear
Returns the 1-based day index in the year of this date.
- daysInMonth
Returns the number of days in the month of this date.
- daysInWeek
Returns the number of days in the week of this date.
- daysInYear
Returns the number of days in the year of this date.
- epochMilliseconds
Returns the number of milliseconds since the Unix epoch to this instant.
- epochNanoseconds
Returns the number of nanoseconds since the Unix epoch to this instant.
- era
Returns the calendar-specific era of this date, or null if not applicable.
- eraYear
Returns the year of this date within the era, or null if not applicable.
- hour
Returns the hour component of this time (0-23).
- hoursInDay
Returns the number of hours in the day of this date in the time zone.
- inLeapYear
Returns true if this date is in a leap year.
- microsecond
Returns the microsecond component of this time (0-999).
- millisecond
Returns the millisecond component of this time (0-999).
- minute
Returns the minute component of this time (0-59).
- month
Returns the 1-based month index in the year of this date.
- monthCode
Returns the calendar-specific string representing the month of this date.
- monthsInYear
Returns the number of months in the year of this date.
- nanosecond
Returns the nanosecond component of this time (0-999).
- offset
Returns the offset used to interpret the internal instant, as a string (±HH:mm).
- offsetNanoseconds
Returns the offset used to interpret the internal instant, as a number of nanoseconds.
- second
Returns the second component of this time (0-59).
- timeZoneId
Returns the time zone identifier used to interpret the internal instant.
- weekOfYear
Returns the 1-based week index in the year of this date, or null if not defined.
- year
Returns the year of this date relative to the calendar's epoch.
- yearOfWeek
Returns the year to be paired with the weekOfYear of this date, or null if not defined.
- clone
Returns a clone of this ZonedDateTime instance.
- deinit
Frees the resources associated with this ZonedDateTime instance.
Aliases
- Unit
The unit of time used for rounding and difference calculations.
- RoundingMode
The rounding mode used for rounding operations.
- Sign
The sign of a duration or difference.
- DifferenceSettings
Options for difference calculations between ZonedDateTime instances.
- RoundOptions
Options for rounding ZonedDateTime instances.