TemporalZ

PlainDateTime

The Temporal.PlainDateTime object represents a calendar date and wall-clock time, but no time zone or offset.

See: Temporal.PlainDateTime

Fields

#
_inner:*abi.c.PlainDateTime

Internal pointer to the underlying C PlainDateTime object.

Types

#
CalendarDisplay

Controls how the calendar is displayed in string output.

ToStringOptions

Options for toString() method.

ToZonedDateTimeOptions

Options for toZonedDateTime() method.

WithOptions

Options for with() method.

Functions

#
init

Creates a new PlainDateTime with all date and time components.

calInit

Creates a new PlainDateTime with a specific calendar.

from

Creates a PlainDateTime from another PlainDateTime, PlainDate, PlainTime, or from a string (ISO 8601) or UTF-16 array.

compare

Compares two PlainDateTime objects. Returns -1, 0, or 1.

equals

Returns true if two PlainDateTime objects represent the same date and time.

add

Returns a new PlainDateTime by adding a Duration to this date-time.

subtract

Returns a new PlainDateTime by subtracting a Duration from this date-time.

until

Returns the Duration until another PlainDateTime, according to the given settings.

since

Returns the Duration since another PlainDateTime, according to the given settings.

round

Returns a new PlainDateTime rounded according to the given options.

calendarId

Returns the calendar identifier for this date-time.

day

Returns the day of the month (1-31).

dayOfWeek

Returns the day of the week (1 = Monday, 7 = Sunday).

dayOfYear

Returns the day of the year (1-366).

daysInMonth

Returns the number of days in the month for this date-time.

daysInWeek

Returns the number of days in the week for this date-time.

daysInYear

Returns the number of days in the year for this date-time.

month

Returns the month (1-12).

monthCode

Returns the month code (e.g., "M03").

monthsInYear

Returns the number of months in the year for this date-time.

year

Returns the year.

inLeapYear

Returns true if the year is a leap year.

era

Returns the era for this date-time, if any.

eraYear

Returns the era year for this date-time, if any.

weekOfYear

Returns the week of the year for this date-time, if any.

yearOfWeek

Returns the year of the week for this date-time, if any.

hour

Returns the hour (0-23).

minute

Returns the minute (0-59).

second

Returns the second (0-59).

millisecond

Returns the millisecond (0-999).

microsecond

Returns the microsecond (0-999).

nanosecond

Returns the nanosecond (0-999).

with

Returns a new PlainDateTime with some fields replaced.

withCalendar

Returns a new PlainDateTime with a different calendar.

withPlainTime

Returns a new PlainDateTime with the time fields replaced by the given PlainTime (or zeroed if null).

toPlainDate

Returns a PlainDate representing the date part of this PlainDateTime.

toPlainTime

Returns a PlainTime representing the time part of this PlainDateTime.

toZonedDateTime

Returns a ZonedDateTime by combining this date-time with a time zone.

toString

Returns a string representation of the date-time.

toJSON

Returns a string suitable for use as JSON.

toLocaleString

Returns a locale-specific string representation of the date-time.

valueOf

Not supported. Throws ComparisonNotSupported error.

deinit

Frees resources associated with this PlainDateTime.

Aliases

#
Unit

Units used for date and time calculations.

RoundingMode

Rounding modes for date/time operations.

Sign

Sign type for durations.

DifferenceSettings

Settings for difference calculations between date-times.

RoundOptions

Options for rounding operations.