diff --git a/docs/zoneddatetime.md b/docs/zoneddatetime.md index 40c9a86164..43065b6698 100644 --- a/docs/zoneddatetime.md +++ b/docs/zoneddatetime.md @@ -28,7 +28,7 @@ The `Temporal.ZonedDateTime` API is a superset of `Temporal.DateTime`, which mak ## Constructor -### **new Temporal.ZonedDateTime**(_epochNanoseconds_: bigint, _timeZone_: string | object, _calendar_: string | object) : Temporal.ZonedDateTime +### **new Temporal.ZonedDateTime**(_epochNanoseconds_: bigint, _timeZone_: string | object, _calendar_?: string | object) : Temporal.ZonedDateTime **Parameters:** @@ -1218,9 +1218,9 @@ zdt.toMonthDay(); // => 12-07 zdt.toTime(); // => 03:24:30 ``` -### zonedDateTime.**getFields**() : { year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number, microsecond: number, nanosecond: number, calendar: object, [propName: string]: unknown } +### zonedDateTime.**getFields**() : { year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number, microsecond: number, nanosecond: number, offset: string, timeZone: object, calendar: object, [propName: string]: unknown } -**Returns:** a plain object with properties equal to the fields of `zonedDateTime`, including all date/time fields (expressed in the current calendar) as well as the `calendar`, `timeZone`, and `offsetNanoseconds` properties. +**Returns:** a plain object with properties equal to the fields of `zonedDateTime`, including all date/time fields (expressed in the current calendar) as well as the `calendar`, `timeZone`, and `offset` properties. This method can be used to convert a `Temporal.ZonedDateTime` into a record-like data structure. It returns a new plain JavaScript object, with all the fields as enumerable, writable, own data properties. @@ -1263,9 +1263,9 @@ JSON.stringify(thisWillWork, undefined, 2); // }" ``` -### zonedDateTime.**getISOFields**(): { isoYear: number, isoMonth: number, isoDay: number, hour: number, minute: number, second: number, millisecond: number, microsecond: number, nanosecond: number, calendar: object } +### zonedDateTime.**getISOFields**(): { isoYear: number, isoMonth: number, isoDay: number, hour: number, minute: number, second: number, millisecond: number, microsecond: number, nanosecond: number, offset: string, timeZone: object, calendar: object } -**Returns:** a plain object with properties expressing `zonedDateTime` in the ISO 8601 calendar, including all date/time fields as well as the `calendar`, `timeZone`, and `offsetNanoseconds` properties. +**Returns:** a plain object with properties expressing `zonedDateTime` in the ISO 8601 calendar, including all date/time fields as well as the `calendar`, `timeZone`, and `offset` properties. Note that date/time properties have different names with an `iso` prefix to better differentiate from "normal" `getFields` results. This is an advanced method that's mainly useful if you are implementing a custom calendar. diff --git a/polyfill/index.d.ts b/polyfill/index.d.ts index c19fe08ab9..b62c7437fb 100644 --- a/polyfill/index.d.ts +++ b/polyfill/index.d.ts @@ -444,6 +444,7 @@ export namespace Temporal { toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; toJSON(): string; toString(tzLike?: TimeZoneProtocol | string, options?: ToStringOptions): string; + valueOf(): never; } export interface CalendarProtocol { @@ -656,6 +657,7 @@ export namespace Temporal { toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; toJSON(): string; toString(): string; + valueOf(): never; } export type DateTimeLike = { @@ -824,6 +826,7 @@ export namespace Temporal { toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; toJSON(): string; toString(options?: ToStringOptions): string; + valueOf(): never; } export type MonthDayLike = { @@ -859,6 +862,7 @@ export namespace Temporal { toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; toJSON(): string; toString(): string; + valueOf(): never; } export type TimeLike = { @@ -976,6 +980,7 @@ export namespace Temporal { toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; toJSON(): string; toString(options?: ToStringOptions): string; + valueOf(): never; } /** @@ -1074,6 +1079,7 @@ export namespace Temporal { toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; toJSON(): string; toString(): string; + valueOf(): never; } /** diff --git a/spec.html b/spec.html index 35d2c968b9..712604b529 100644 --- a/spec.html +++ b/spec.html @@ -16,6 +16,7 @@

Introduction

+ diff --git a/spec/abstractops.html b/spec/abstractops.html index 84e25fb8fd..e6f0acfcfe 100644 --- a/spec/abstractops.html +++ b/spec/abstractops.html @@ -162,6 +162,17 @@

NegateTemporalRoundingMode ( _roundingMode_ )

+ +

ToTemporalOffset ( _normalizedOptions_, _fallback_ )

+

+ The abstract operation ToTemporalOffset extracts the value of the property named *"offset"* from _normalizedOptions_ and makes sure it is a valid value for the option. + The value _fallback_ is returned if the property is not present. +

+ + 1. Return ? GetOption(_normalizedOptions_, *"offset"*, *"string"*, « *"prefer"*, *"use"*, *"ignore"*, *"reject"* », _fallback_). + +
+

ToTemporalRoundingIncrement ( _normalizedOptions_, _dividend_, _inclusive_ )

diff --git a/spec/intl.html b/spec/intl.html index d2a140af55..9e62161041 100644 --- a/spec/intl.html +++ b/spec/intl.html @@ -245,6 +245,11 @@

InitializeDateTimeFormat ( _dateTimeFormat_, _locales_, _options_ )

[[weekday]], [[era]], [[year]], [[month]], [[day]], [[hour]], [[minute]], [[second]], [[dayPeriod]], [[fractionalSecondDigits]] [[year]], [[month]], [[day]], [[hour]], [[minute]], [[second]] + + [[TemporalZonedDateTimePattern]] + [[weekday]], [[era]], [[year]], [[month]], [[day]], [[hour]], [[minute]], [[second]], [[dayPeriod]], [[fractionalSecondDigits]], [[timeZoneName]] + [[year]], [[month]], [[day]], [[hour]], [[minute]], [[second]], [[timeZoneName]] + @@ -309,6 +314,12 @@

PartitionDateTimePattern ( _dateTimeFormat_, _x_ )

1. If _calendar_ is not *"iso8601"* and not equal to _dateTimeFormat_.[[Calendar]], throw a *RangeError* exception. 1. Let _pattern_ be _dateTimeFormat_.[[TemporalDateTimePattern]]. 1. Let _tm_ be { [[weekday]]: ToDayOfWeek(_x_.[[ISOYear]], _x_.[[ISOMonth]], _x_.[[ISODay]]), [[year]]: _x_.[[ISOYear]], [[month]]: _x_.[[ISOMonth]], [[day]]: _x_.[[ISODay]], [[hour]]: _x_.[[Hour]], [[minute]]: _x_.[[Minute]], [[second]]: _x_.[[Second]] }. + 1. If _date_ has an [[InitializedTemporalZonedDateTime]] internal slot, then + 1. Let _calendar_ be ? CalendarToString(_x_). + 1. If _calendar_ is not *"iso8601"* and not equal to _dateTimeFormat_.[[Calendar]], then + 1. Throw a *RangeError* exception. + 1. Let _pattern_ be _dateTimeFormat_.[[TemporalZonedDateTimePattern]]. + 1. Let _tm_ be { [[weekday]]: TODO, [[year]]: TODO, [[month]]: TODO, [[day]]: TODO, [[hour]]: TODO, [[minute]]: TODO, [[second]]: TODO, [[timeZoneName]]: ? TimeZoneToString(_date_) }. 1. If _pattern_ is *null*, throw a *TypeError* exception. 1. Else, 1. Let _pattern_ be _dateTimeFormat_.[[Pattern]]. diff --git a/spec/timezone.html b/spec/timezone.html index d4b60cb99e..eb7a5f96c4 100644 --- a/spec/timezone.html +++ b/spec/timezone.html @@ -489,5 +489,36 @@

ParseOffsetNanoseconds ( _identifier_ )

1. Return _sign_ × (_hours_ × 60 + _minutes_) × 60 × 1,000,000,000.
+ + +

+ The abstract operation CompareTimeZone lexicographically compares the + results of calling `toString()` on its arguments. +

+

CompareTimeZone ( _one_, _two_ )

+ + 1. Let _calendarOne_ be ? TimeZoneToString(_one_). + 1. Let _calendarTwo_ be ? TimeZoneToString(_two_). + 1. Let _r_ be the result of performing Abstract Relational Comparison _timeZoneOne_ < _timeZoneTwo_. + 1. If _r_ is *true*, return −1. + 1. Let _r_ be the result of performing Abstract Relational Comparison _timeZoneTwo_ < _timeZoneOne_. + 1. If _r_ is *true*, return 1. + 1. Return 0. + +
+ + +

TimeZoneEquals ( _one_, _two_ )

+

+ The abstract operation TimeZoneEquals returns *true* if the results of + calling `toString()` on its arguments are equal. +

+ + 1. Let _timeZoneOne_ be ? TimeZoneToString(_one_). + 1. Let _timeZoneTwo_ be ? TimeZoneToString(_two_). + 1. If _timeZoneOne_ is _timeZoneTwo_, return *true*. + 1. Return *false*. + +
diff --git a/spec/zoneddatetime.html b/spec/zoneddatetime.html new file mode 100644 index 0000000000..5b0830c64d --- /dev/null +++ b/spec/zoneddatetime.html @@ -0,0 +1,1048 @@ + + + + +

Temporal.ZonedDateTime Objects

+

+ A Temporal.ZonedDateTime object is an immutable Object referencing a point in time with nanoseconds precision, and containing Object values corresponding to a particular time zone and calendar system. +

+ + +

The Temporal.ZonedDateTime Constructor

+

+ The Temporal.ZonedDateTime constructor is the %Temporal.ZonedDateTime% intrinsic object. + When called as a constructor, it creates and initializes a new Temporal.ZonedDateTime object. +

+

+ The Temporal.ZonedDateTime constructor is designed to be subclassable. + It may be used as the value of an extends clause of a class definition. + Subclass constructors that intend to inherit the specified ZonedDateTime behaviour must include a super call to the %Temporal.ZonedDateTime% constructor to create and initialize subclass instances with the necessary internal slots. +

+ + +

Temporal.ZonedDateTime ( _epochNanoseconds_, _timeZoneLike_ [ , _calendarLike_ ] )

+

+ When the `Temporal.ZonedDateTime` function is called, the following steps are taken: +

+ + 1. If NewTarget is *undefined*, then + 1. Throw a *TypeError* exception. + 1. Set _epochNanoseconds_ to ? ToBigInt(_epochNanoseconds_). + 1. Perform ? RejectInstant(_epochNanoseconds_). + 1. Let _timeZone_ be ? ToTemporalTimeZone(_timeZoneLike_). + 1. If _calendarLike_ is *undefined*, then + 1. Set _calendar_ to ? GetISO8601Calendar(). + 1. Else, + 1. Set _calendar_ to ? ToTemporalCalendar(_calendarLike_). + 1. Return ? CreateTemporalZonedDateTime(_epochNanoseconds_, _timeZone_, _calendar_, NewTarget). + +
+
+ + +

Properties of the Temporal.ZonedDateTime Constructor

+

The value of the [[Prototype]] internal slot of the Temporal.ZonedDateTime constructor is the intrinsic object %Function.prototype%.

+

The Temporal.ZonedDateTime constructor has the following properties:

+ + +

Temporal.ZonedDateTime.prototype

+

The initial value of `Temporal.ZonedDateTime.prototype` is %Temporal.ZonedDateTime.prototype%.

+

This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

+
+ + +

get Temporal.ZonedDateTime [ @@species ]

+

+ `Temporal.ZonedDateTime[@@species]` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Return the *this* value. + + +

The value of the *"name"* property of this function is *"get [Symbol.species]"*.

+
+ + +

Temporal.ZonedDateTime.from ( _item_ [ , _options_ ] )

+

+ The `from` method takes two arguments, _item_ and _options_. + The following steps are taken: +

+ + 1. Let _constructor_ be the *this* value. + 1. Set _options_ to ? NormalizeOptionsObject(_options_). + 1. Let _overflow_ be ? ToTemporalOverflow(_options_). + 1. Let _disambiguation_ be ? ToTemporalDisambiguation(_options_). + 1. Let _offset_ be ? ToTemporalOffset(_options_). + 1. Return ? ToTemporalZonedDateTime(_item_, _constructor_, _overflow_, _disambiguation_, _offset_). + +
+ + +

Temporal.ZonedDateTime.compare ( _one_, _two_ )

+

+ The `compare` method takes two arguments, _one_ and _two_. + The following steps are taken: +

+ + 1. Set _one_ to ? ToTemporalZonedDateTime(_one_). + 1. Set _two_ to ? ToTemporalZonedDateTime(_two_). + 1. Let _result_ be ! CompareEpochNanoseconds(_one_.[[Nanoseconds]], _two_.[[Nanoseconds]]). + 1. If _result_ ≠ 0, then + 1. Return 𝔽(_result_). + 1. Set _result_ to ? CompareCalendar(_one_.[[Calendar]], _two_.[[Calendar]]). + 1. If _result_ ≠ 0, then + 1. Return 𝔽(_result_). + 1. Return 𝔽(? CompareTimeZone(_one_.[[TimeZone]], _two_.[[TimeZone]]). + +
+
+ + +

Properties of the Temporal.ZonedDateTime Prototype Object

+ +

The Temporal.ZonedDateTime prototype object

+ + + +

Temporal.ZonedDateTime.prototype.constructor

+

The initial value of `Temporal.ZonedDateTime.prototype.constructor` is %Temporal.ZonedDateTime%.

+
+ + +

Temporal.ZonedDateTime.prototype[ @@toStringTag ]

+

+ The initial value of the @@toStringTag property is the string value `"Temporal.ZonedDateTime"`. +

+

+ This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. +

+
+ + +

get Temporal.ZonedDateTime.prototype.calendar

+

+ `Temporal.ZonedDateTime.prototype.calendar` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Return _zonedDateTime_.[[Calendar]]. + +
+ + +

get Temporal.ZonedDateTime.prototype.timeZone

+

+ `Temporal.ZonedDateTime.prototype.timeZone` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Return _zonedDateTime_.[[TimeZone]]. + +
+ + +

get Temporal.ZonedDateTime.prototype.year

+

+ `Temporal.ZonedDateTime.prototype.year` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Let _calendar_ be _zonedDateTime_.[[Calendar]]. + 1. Let _year_ be ? Get(_calendar_, *"year"*). + 1. Return ? Call(_year_, _calendar_, « _temporalDateTime_ »). + +
+ + +

get Temporal.ZonedDateTime.prototype.month

+

+ `Temporal.ZonedDateTime.prototype.month` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Let _calendar_ be _zonedDateTime_.[[Calendar]]. + 1. Let _month_ be ? Get(_calendar_, *"month"*). + 1. Return ? Call(_month_, _calendar_, « _temporalDateTime_ »). + +
+ + +

get Temporal.ZonedDateTime.prototype.day

+

+ `Temporal.ZonedDateTime.prototype.day` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Let _calendar_ be _zonedDateTime_.[[Calendar]]. + 1. Let _day_ be ? Get(_calendar_, *"day"*). + 1. Return ? Call(_day_, _calendar_, « _temporalDateTime_ »). + +
+ + +

get Temporal.ZonedDateTime.prototype.hour

+

+ `Temporal.ZonedDateTime.prototype.hour` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Return _temporalDateTime_.[[Hour]]. + +
+ + +

get Temporal.ZonedDateTime.prototype.minute

+

+ `Temporal.ZonedDateTime.prototype.minute` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Return _temporalDateTime_.[[Minute]]. + +
+ + +

get Temporal.ZonedDateTime.prototype.second

+

+ `Temporal.ZonedDateTime.prototype.second` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Return _temporalDateTime_.[[Second]]. + +
+ + +

get Temporal.ZonedDateTime.prototype.millisecond

+

+ `Temporal.ZonedDateTime.prototype.millisecond` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Return _temporalDateTime_.[[Millisecond]]. + +
+ + +

get Temporal.ZonedDateTime.prototype.microsecond

+

+ `Temporal.ZonedDateTime.prototype.microsecond` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Return _temporalDateTime_.[[Microsecond]]. + +
+ + +

get Temporal.ZonedDateTime.prototype.nanosecond

+

+ `Temporal.ZonedDateTime.prototype.nanosecond` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Return _temporalDateTime_.[[Nanosecond]]. + +
+ + +

get Temporal.ZonedDateTime.prototype.epochSeconds

+

+ `Temporal.ZonedDateTime.prototype.epochSeconds` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_instant_, [[InitializedTemporalZonedDateTime]]). + 1. Let _ns_ be _zonedDateTime_.[[Nanoseconds]]. + 1. Let _s_ be RoundTowardsZero(ℝ(_ns_) / 1,000,000,000). + 1. Return 𝔽(_s_). + +
+ + +

get Temporal.ZonedDateTime.prototype.epochMilliseconds

+

+ `Temporal.ZonedDateTime.prototype.epochMilliseconds` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_instant_, [[InitializedTemporalZonedDateTime]]). + 1. Let _ns_ be _zonedDateTime_.[[Nanoseconds]]. + 1. Let _ms_ be RoundTowardsZero(ℝ(_ns_) / 1,000,000). + 1. Return 𝔽(_ms_). + +
+ + +

get Temporal.ZonedDateTime.prototype.epochMicroseconds

+

+ `Temporal.ZonedDateTime.prototype.epochMicroseconds` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_instant_, [[InitializedTemporalZonedDateTime]]). + 1. Let _ns_ be _zonedDateTime_.[[Nanoseconds]]. + 1. Let _µs_ be RoundTowardsZero(ℝ(_ns_) / 1,000). + 1. Return ℤ(_µs_). + +
+ + +

get Temporal.ZonedDateTime.prototype.epochNanoseconds

+

+ `Temporal.ZonedDateTime.prototype.epochNanoseconds` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_instant_, [[InitializedTemporalZonedDateTime]]). + 1. Return _zonedDateTime_.[[Nanoseconds]]. + +
+ + +

get Temporal.ZonedDateTime.prototype.dayOfWeek

+

+ `Temporal.ZonedDateTime.prototype.dayOfWeek` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Let _calendar_ be _zonedDateTime_.[[Calendar]]. + 1. Let _dayOfWeek_ be ? Get(_calendar_, *"dayOfWeek"*). + 1. Return ? Call(_dayOfWeek_, _calendar_, « _temporalDateTime_ »). + +
+ + +

get Temporal.ZonedDateTime.prototype.dayOfYear

+

+ `Temporal.ZonedDateTime.prototype.dayOfYear` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Let _calendar_ be _zonedDateTime_.[[Calendar]]. + 1. Let _dayOfYear_ be ? Get(_calendar_, *"dayOfYear"*). + 1. Return ? Call(_dayOfYear_, _calendar_, « _temporalDateTime_ »). + +
+ + +

get Temporal.ZonedDateTime.prototype.weekOfYear

+

+ `Temporal.ZonedDateTime.prototype.weekOfYear` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Let _calendar_ be _zonedDateTime_.[[Calendar]]. + 1. Let _weekOfYear_ be ? Get(_calendar_, *"weekOfYear"*). + 1. Return ? Call(_weekOfYear_, _calendar_, « _temporalDateTime_ »). + +
+ + +

get Temporal.ZonedDateTime.prototype.hoursInDay

+

+ `Temporal.ZonedDateTime.prototype.hoursInDay` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Return TODO. + +
+ + +

get Temporal.ZonedDateTime.prototype.daysInWeek

+

+ `Temporal.ZonedDateTime.prototype.daysInWeek` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Let _calendar_ be _zonedDateTime_.[[Calendar]]. + 1. Let _daysInWeek_ be ? Get(_calendar_, *"daysInWeek"*). + 1. Return ? Call(_daysInWeek_, _calendar_, « _temporalDateTime_ »). + +
+ + +

get Temporal.ZonedDateTime.prototype.daysInMonth

+

+ `Temporal.ZonedDateTime.prototype.daysInMonth` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Let _calendar_ be _zonedDateTime_.[[Calendar]]. + 1. Let _daysInMonth_ be ? Get(_calendar_, *"daysInMonth"*). + 1. Return ? Call(_daysInMonth_, _calendar_, « _temporalDateTime_ »). + +
+ + +

get Temporal.ZonedDateTime.prototype.daysInYear

+

+ `Temporal.ZonedDateTime.prototype.daysInYear` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Let _calendar_ be _zonedDateTime_.[[Calendar]]. + 1. Let _daysInYear_ be ? Get(_calendar_, *"daysInYear"*). + 1. Return ? Call(_daysInYear_, _calendar_, « _temporalDateTime_ »). + +
+ + +

get Temporal.ZonedDateTime.prototype.monthsInYear

+

+ `Temporal.ZonedDateTime.prototype.monthsInYear` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Let _calendar_ be _zonedDateTime_.[[Calendar]]. + 1. Let _monthsInYear_ be ? Get(_calendar_, *"monthsInYear"*). + 1. Return ? Call(_monthsInYear_, _calendar_, « _temporalDateTime_ »). + +
+ + +

get Temporal.ZonedDateTime.prototype.inLeapYear

+

+ `Temporal.ZonedDateTime.prototype.inLeapYear` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Let _calendar_ be _zonedDateTime_.[[Calendar]]. + 1. Let _inLeapYear_ be ? Get(_calendar_, *"inLeapYear"*). + 1. Return ? Call(_inLeapYear_, _calendar_, « _temporalDateTime_ »). + +
+ + +

get Temporal.ZonedDateTime.prototype.startOfDay

+

+ `Temporal.ZonedDateTime.prototype.startOfDay` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Return TODO. + +
+ + +

get Temporal.ZonedDateTime.prototype.offset

+

+ `Temporal.ZonedDateTime.prototype.offset` is an accessor property whose set accessor function is *undefined*. + Its get accessor function performs the following steps: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Return ? GetOffsetStringFor(_zonedDateTime_.[[TimeZone]], _instant_). + +
+ + +

Temporal.ZonedDateTime.prototype.with ( _temporalZonedDateTimeLike_ [ , _options_ ] )

+

+ The `with` method takes two arguments, _temporalZonedDateTimeLike_ and _options_. + The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _partialZonedDateTime_ be ? ToPartialZonedDateTime(_temporalZonedDateTimeLike_). + 1. Set _options_ to ? NormalizeOptionsObject(_options_). + 1. Let _overflow_ be ? ToTemporalOverflow(_options_). + 1. Let _disambiguation_ be ? ToTemporalDisambiguation(_options_). + 1. Let _offset_ be ? ToTemporalOffset(_options_, *"prefer"*). + 1. TODO. + 1. Return ? CreateTemporalZonedDateTimeFromInstance(_zonedDateTime_, _epochNanoseconds_, _timeZone_, _calendar_). + +
+ + +

Temporal.ZonedDateTime.prototype.withTimeZone ( _timeZoneLike_ )

+

+ The `withTimeZone` method takes one argument _timeZoneLike_. + The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be ? ToTemporalTimeZone(_timeZoneLike_). + 1. Return ? CreateTemporalZonedDateTimeFromInstance(_zonedDateTime_, _zonedDateTime_.[[Nanoseconds]], _timeZoneLike_, _zonedDateTime_.[[Calendar]]). + +
+ + +

Temporal.ZonedDateTime.prototype.withCalendar ( _calendarLike_ )

+

+ The `withCalendar` method takes one argument _calendarLike_. + The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _calendar_ be ? ToTemporalCalendar(_calendarLike_). + 1. Return ? CreateTemporalZonedDateTimeFromInstance(_zonedDateTime_, _zonedDateTime_.[[Nanoseconds]], _zonedDateTime_.[[TimeZone]], _calendar_). + +
+ + +

Temporal.ZonedDateTime.prototype.add ( _temporalDurationLike_ [ , _options_ ] )

+

+ The `add` method takes two arguments, _temporalDurationLike_ and _options_. + The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _duration_ be ? ToLimitedTemporalDuration(_temporalDurationLike_, « »). + 1. Perform ? RejectDurationSign(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]]). + 1. Set _options_ to ? NormalizeOptionsObject(_options_). + 1. Let _overflow_ be ? ToTemporalOverflow(_options_). + 1. TODO. + 1. Return ? CreateTemporalZonedDateTimeFromInstance(_zonedDateTime_, _epochNanoseconds_, _timeZone_, _calendar_). + +
+ + +

Temporal.ZonedDateTime.prototype.subtract ( _temporalDurationLike_ [ , _options_ ] )

+

+ The `subtract` method takes two arguments, _temporalDurationLike_ and _options_. + The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _duration_ be ? ToLimitedTemporalDuration(_temporalDurationLike_, « »). + 1. Perform ? RejectDurationSign(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]]). + 1. Set _options_ to ? NormalizeOptionsObject(_options_). + 1. Let _overflow_ be ? ToTemporalOverflow(_options_). + 1. TODO. + 1. Return ? CreateTemporalZonedDateTimeFromInstance(_zonedDateTime_, _epochNanoseconds_, _timeZone_, _calendar_). + +
+ + +

Temporal.ZonedDateTime.prototype.until ( _other_ [ , _options_ ] )

+

+ The `until` method takes two arguments, _other_ and _options_. + The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Set _other_ to ? ToTemporalZonedDateTime(_other_). + 1. If ? CalendarEquals(_zonedDateTime_.[[Calendar]], _other_.[[Calendar]]) is *false*, then + 1. Throw a *RangeError* exception. + 1. Set _options_ to ? NormalizeOptionsObject(_options_). + 1. Let _smallestUnit_ be ? ToSmallestTemporalDurationUnit(_options_, « », *"nanoseconds"*). + 1. Let _defaultLargestUnit_ be ! LargerOfTwoTemporalDurationUnits(*"days"*, _smallestUnit_). + 1. Let _largestUnit_ be ? ToLargestTemporalUnit(_options_, « », _defaultLargestUnit_). + 1. Perform ? ValidateTemporalUnitRange(_largestUnit_, _smallestUnit_). + 1. Let _roundingMode_ be ? ToTemporalRoundingMode(_options_). + 1. Let _maximum_ be ! MaximumTemporalDurationRoundingIncrement(_smallestUnit_). + 1. Let _roundingIncrement_ be ? ToTemporalRoundingIncrement(_options_, _maximum_, *false*). + 1. TODO. + 1. Return ? CreateTemporalDuration(TODO). + +
+ + +

Temporal.ZonedDateTime.prototype.since ( _other_ [ , _options_ ] )

+

+ The `since` method takes two arguments, _other_ and _options_. + The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Set _other_ to ? ToTemporalZonedDateTime(_other_). + 1. If ? CalendarEquals(_zonedDateTime_.[[Calendar]], _other_.[[Calendar]]) is *false*, then + 1. Throw a *RangeError* exception. + 1. Set _options_ to ? NormalizeOptionsObject(_options_). + 1. Let _smallestUnit_ be ? ToSmallestTemporalDurationUnit(_options_, « », *"nanoseconds"*). + 1. Let _defaultLargestUnit_ be ! LargerOfTwoTemporalDurationUnits(*"days"*, _smallestUnit_). + 1. Let _largestUnit_ be ? ToLargestTemporalUnit(_options_, « », _defaultLargestUnit_). + 1. Perform ? ValidateTemporalUnitRange(_largestUnit_, _smallestUnit_). + 1. Let _roundingMode_ be ? ToTemporalRoundingMode(_options_). + 1. Set _roundingMode_ to ! NegateTemporalRoundingMode(_roundingMode_). + 1. Let _maximum_ be ! MaximumTemporalDurationRoundingIncrement(_smallestUnit_). + 1. Let _roundingIncrement_ be ? ToTemporalRoundingIncrement(_options_, _maximum_, *false*). + 1. TODO. + 1. Return ? CreateTemporalDuration(TODO). + +
+ + +

Temporal.ZonedDateTime.prototype.round ( _options_ )

+

+ The `round` method takes one argument _options_. + The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. If _options_ is *undefined*, then + 1. Throw a *TypeError* exception. + 1. Set _options_ to ? NormalizeOptionsObject(_options_). + 1. Let _smallestUnit_ be ? ToSmallestTemporalUnit(_options_, « »). + 1. Let _roundingMode_ be ? ToTemporalRoundingMode(_options_). + 1. If _smallestUnit_ is *"day"*, then + 1. Let _maximum_ be 1. + 1. Else if _smallestUnit_ is *"hour"*, then + 1. Let _maximum_ be 24. + 1. Else if _smallestUnit_ is *"minute"* or *"second"*, then + 1. Let _maximum_ be 60. + 1. Else, + 1. Let _maximum_ be 1000. + 1. Let _roundingIncrement_ be ? ToTemporalRoundingIncrement(_options_, _maximum_, *false*). + 1. TODO. + 1. Return ? CreateTemporalZonedDateTimeFromInstance(_zonedDateTime_, _epochNanoseconds_, _zonedDateTime_.[[TimeZone]], _zonedDateTime_.[[Calendar]]). + +
+ + +

Temporal.ZonedDateTime.prototype.equals ( _other_ )

+

+ The `equals` method takes one argument _other_. + The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Set _other_ to ? ToTemporalZonedDateTime(_other_). + 1. If _zonedDateTime_.[[Nanoseconds]] ≠ _other_.[[Nanoseconds]], return *false*. + 1. If ? TimeZoneEquals(_zonedDateTime_.[[TimeZone]], _other_.[[TimeZone]]) is *false*, return *false*. + 1. Return ? CalendarEquals(_zonedDateTime_.[[Calendar]], _other_.[[Calendar]]). + +
+ + +

Temporal.ZonedDateTime.prototype.toString ( )

+

+ The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Return ? TemporalZonedDateTimeToString(_zonedDateTime_). + +
+ + +

Temporal.ZonedDateTime.prototype.toLocaleString ( [ _locales_ [ , _options_ ] ] )

+

+ The `toLocaleString` method takes two arguments, _locales_ and _options_. + The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. If the implementation does not include the ECMA-402 Internationalization API, then + 1. Return ? TemporalZonedDateTimeToString(_zonedDateTime_). + 1. Let _dateFormat_ be ? Construct(%DateTimeFormat%, « _locales_, _options_ »). + 1. Return ? FormatDateTime(_dateFormat_, _zonedDateTime_). + +
+ + +

Temporal.ZonedDateTime.prototype.toJSON ( )

+

+ The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Return ! TemporalZonedDateTimeToString(_zonedDateTime_). + +
+ + +

Temporal.ZonedDateTime.prototype.valueOf ( )

+

+ The following steps are taken: +

+ + 1. Throw a *TypeError* exception. + +
+ + +

Temporal.ZonedDateTime.prototype.toInstant ( )

+

+ The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Return ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + +
+ + +

Temporal.ZonedDateTime.prototype.toDate ( )

+

+ The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Return ? CreateTemporalDate(_temporalDateTime_.[[ISOYear]], _temporalDateTime_.[[ISOMonth]], _temporalDateTime_.[[ISODay]], _zonedDateTime_.[[Calendar]]). + +
+ + +

Temporal.ZonedDateTime.prototype.toTime ( )

+

+ The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Return ? CreateTemporalTime(_temporalDateTime_.[[Hour]], _temporalDateTime_.[[Minute]], _temporalDateTime_.[[Second]], _temporalDateTime_.[[Millisecond]], _temporalDateTime_.[[Microsecond]], _temporalDateTime_.[[Nanosecond]]). + +
+ + +

Temporal.ZonedDateTime.prototype.toDateTime ( )

+

+ The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Return ? GetTemporalDateTimeFor(_timeZone_, _instant_). + +
+ + +

Temporal.ZonedDateTime.prototype.toYearMonth ( )

+

+ The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Return ? create via `calendar.yearMonthFromFields()`. + +
+ + +

Temporal.ZonedDateTime.prototype.toMonthDay ( )

+

+ The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _timeZone_ be _zonedDateTime_.[[TimeZone]]. + 1. Let _instant_ be ? CreateTemporalInstant(_zonedDateTime_.[[Nanoseconds]]). + 1. Let _temporalDateTime_ be ? GetTemporalDateTimeFor(_timeZone_, _instant_). + 1. Return ? create via `calendar.monthDayFromFields()`. + +
+ + +

Temporal.ZonedDateTime.prototype.getFields ( )

+

+ The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. TODO. + +
+ + +

Temporal.ZonedDateTime.prototype.getISOFields ( )

+

+ The following steps are taken: +

+ + 1. Let _zonedDateTime_ be the *this* value. + 1. Perform ? RequireInternalSlot(_zonedDateTime_, [[InitializedTemporalZonedDateTime]]). + 1. Let _fields_ be ? ObjectCreate(%ObjectPrototype%). + 1. TODO. + 1. Perform ! CreateDataPropertyOrThrow(_fields_, *"timeZone"*, _zonedDateTime_.[[TimeZone]]). + 1. Perform ! CreateDataPropertyOrThrow(_fields_, *"calendar"*, _zonedDateTime_.[[Calendar]]). + 1. Return _fields_. + +
+
+ + +

Properties of Temporal.ZonedDateTime Instances

+

+ Temporal.ZonedDateTime instances are ordinary objects that inherit properties from the %Temporal.ZonedDateTime.prototype% intrinsic object. + Temporal.ZonedDateTime instances are initially created with the internal slots described in . +

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ Internal Slot + + Description +
+ [[InitializedTemporalZonedDateTime]] + + The only specified use of this slot is for distinguishing Temporal.ZonedDateTime instances from other objects. +
+ [[Nanoseconds]] + + A BigInt value representing the number of nanoseconds since the Unix epoch. +
+ [[TimeZone]] + + An Object representing the time zone. +
+ [[Calendar]] + + An Object representing the calendar. +
+
+
+ + +

Abstract operations

+ + +

ToTemporalZonedDateTime ( _item_ [ , _constructor_ [ , _overflow_, _disambiguation_, _offset_ ] ] )

+

+ The abstract operation ToTemporalZonedDateTime returns its argument _item_ if it is already a Temporal.ZonedDateTime instance, converts _item_ to a new Temporal.Date instance if possible, and throws otherwise. +

+ + 1. If _constructor_ is not given, set it to %Temporal.ZonedDateTime%. + 1. If _overflow_ is not given, set it to *"constrain"*. + 1. Assert: _overflow_ is either *"constrain"* or *"reject"*. + 1. If _disambiguation_ is not given, set it to *"compatible"*. + 1. Assert: _disambiguation_ is either *"compatible"*, *"earlier"*, *"later"*, or *"reject"*. + 1. If _offset_ is not given, set it to *"reject"*. + 1. Assert: _offset_ is either *"use"*, *"ignore"*, *"prefer"*, or *"reject"*. + 1. If Type(_item_) is Object, then + 1. If _item_ has an [[InitializedTemporalZonedDateTime]] internal slot, then + 1. Return _item_. + 1. Let _result_ be TODO, after landing `Calendar.fields()`. + 1. Else, + 1. Let _string_ be ? ToString(_item_). + 1. Let _result_ be ? ParseTemporalInstantString(_string_). + 1. Let _calendar_ be _result_.[[Calendar]]. + 1. If _calendar_ is *undefined*, set _calendar_ to ! GetISO8601Calendar(). + 1. Set _calendar_ to ? ToTemporalCalendar(_calendar_). + 1. TODO. + 1. Return ? CreateTemporalZonedDateTimeFromStatic(_constructor_, TODO, _timeZone_ , _calendar_). + +
+ + +

ToPartialZonedDateTime ( _temporalZonedDateTimeLike_ )

+

+ The abstract operation ToPartialZonedDateTime ...TODO, after landing `Calendar.fields()`. +

+ + 1. If Type(_temporalZonedDateTimeLike_) is not Object, then + 1. Throw a *TypeError* exception. + 1. TODO. + +
+ + +

CreateTemporalZonedDateTime ( _epochNanoseconds_, _timeZone_, _calendar_ [ , _newTarget_ ] )

+

+ The abstract operation CreateTemporalZonedDateTime is used to specify the creation of a new `Temporal.ZonedDateTime` object. +

+ + 1. Assert: ! ValidateInstant(_epochNanoseconds_) is *true*. + 1. Assert: Type(_timeZone_) is Object. + 1. Assert: Type(_calendar_) is Object. + 1. If _newTarget_ is not given, set it to %Temporal.ZonedDateTime%. + 1. Let _object_ be ? OrdinaryCreateFromConstructor(_newTarget_, `"%Temporal.ZonedDateTime.prototype%"`, « [[InitializedTemporalZonedDateTime]], [[Nanoseconds]], [[TimeZone]], [[Calendar]] »). + 1. Set _object_.[[Nanoseconds]] to _epochNanoseconds_. + 1. Set _object_.[[TimeZone]] to _timeZone_. + 1. Set _object_.[[Calendar]] to _calendar_. + 1. Return _object_. + +
+ + +

CreateTemporalZonedDateTimeFromInstance ( _zonedDateTime_, _epochNanoseconds_, _timeZone_, _calendar_ )

+

+ The abstract operation CreateTemporalZonedDateTimeFromInstance calls the species constructor of the given `Temporal.ZonedDateTime` instance _zonedDateTime_ in order to create a new instance with the given arguments. +

+ + 1. Assert: Type(_zonedDateTime_) is Object and _zonedDateTime_ has an [[InitializedTemporalZonedDateTime]] internal slot. + 1. Assert: ! ValidateInstant(_epochNanoseconds_) is *true*. + 1. Assert: Type(_timeZone_) is Object. + 1. Assert: Type(_calendar_) is Object. + 1. Let _constructor_ be ? SpeciesConstructor(_zonedDateTime_, %Temporal.ZonedDateTime%). + 1. Let _result_ be ? Construct(_constructor_, « _epochNanoseconds_, _timeZone_, _calendar_ »). + 1. Perform ? RequireInternalSlot(_result_, [[InitializedTemporalZonedDateTime]]). + 1. Return _result_. + +
+ + +

CreateTemporalZonedDateTimeFromStatic ( _constructor_, _epochNanoseconds_, _timeZone_, _calendar_ )

+

+ The abstract operation CreateTemporalZonedDateTimeFromStatic calls the given _constructor_ with the given arguments to create a `Temporal.ZonedDateTime` instance. +

+ + 1. Assert: ! ValidateInstant(_epochNanoseconds_) is *true*. + 1. Assert: Type(_timeZone_) is Object. + 1. Assert: Type(_calendar_) is Object. + 1. If ! IsConstructor(_constructor_) is *false*, then + 1. Throw a *TypeError* exception. + 1. Let _result_ be ? Construct(_constructor_, « _epochNanoseconds_, _timeZone_, _calendar_ »). + 1. Perform ? RequireInternalSlot(_result_, [[InitializedTemporalZonedDateTime]]). + 1. Return _result_. + +
+ + +

TemporalZonedDateTimeToString ( _zonedDateTime_ )

+

+ The abstract operation TemporalZonedDateTimeToString returns an ISO 8601 string representation of its argument, including a time zone name annotation and calendar annotation, which are extensions to the ISO 8601 format. +

+ + 1. Assert: Type(_zonedDateTime_) is Object and _zonedDateTime_ has an [[InitializedTemporalZonedDateTime]] internal slot. + 1. TODO. + +
+
+