This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.
TemporalCalendar
Defined in: packages/engine/src/temporal/TemporalCalendar.ts:208
A CalendarBackend over a Temporal implementation, computing in
one named time zone. Build one with createTemporalCalendar.
Every method answers what the Date backend answers for the same inputs
when the zone is the process’s own; see the module comment for the
differences between Temporal and Date that are reproduced deliberately.
The local methods answer NaN for an instant or a date the backend cannot
represent and never throw; the four named-zone methods throw the runtime’s
RangeError for a zone it does not know or an instant it cannot represent,
which is the contract the interface states.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TemporalCalendar(temporal, options?): TemporalCalendar;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:215
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
temporal | TemporalLike |
options | TemporalCalendarOptions |
Returns
Section titled “Returns”TemporalCalendar
Properties
Section titled “Properties”timeZone
Section titled “timeZone”readonly timeZone: string;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:210
The IANA zone every local answer is computed in, in its canonical spelling.
Methods
Section titled “Methods”addDays()
Section titled “addDays()”addDays(epochMs, days): number;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:275
Move an instant by whole calendar days, holding the local wall-clock time. A day that contains a daylight-saving transition is 23 or 25 hours long, so this is a field step, not an addition of milliseconds.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
epochMs | number |
days | number |
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”addMonths()
Section titled “addMonths()”addMonths(epochMs, months): number;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:282
Move an instant by whole calendar months, holding the local wall-clock time and clamping the day to the length of the month landed in: 31 January plus a month is 28 February, or 29 in a leap year, never 3 March.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
epochMs | number |
months | number |
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”fields()
Section titled “fields()”fields(epochMs): CalendarFields;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:243
The local calendar fields of an instant, weekday included. See CalendarFields.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
epochMs | number |
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”fieldsInZone()
Section titled “fieldsInZone()”fieldsInZone(zone, epochMs): ZonedFields;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:389
The calendar date and wall-clock time a named IANA zone shows for an
instant. Throws the runtime’s RangeError for a zone it does not know or
an instant it cannot represent.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
zone | string |
epochMs | number |
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”formatDateInZone()
Section titled “formatDateInZone()”formatDateInZone(zone, epochMs): string;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:404
The calendar date in a named IANA zone, July 31, 2026, in the en-US
style the timezone forms answer in. Throws the runtime’s RangeError for
a zone it does not know or an instant it cannot represent.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
zone | string |
epochMs | number |
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”CalendarBackend.formatDateInZone
formatLongDate()
Section titled “formatLongDate()”formatLongDate(epochMs, locale): string;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:355
The spelled-out local date in a locale, Tuesday, March 10, 2026 in en.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
epochMs | number |
locale | string |
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”CalendarBackend.formatLongDate
formatTimeInZone()
Section titled “formatTimeInZone()”formatTimeInZone(zone, epochMs): string;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:400
The wall-clock time in a named IANA zone, 1:00 AM, in the en-US style
the timezone forms answer in. Throws the runtime’s RangeError for a
zone it does not know or an instant it cannot represent.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
zone | string |
epochMs | number |
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”CalendarBackend.formatTimeInZone
formatTimeOfDay()
Section titled “formatTimeOfDay()”formatTimeOfDay(epochMs, locale): string;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:365
The local time of day in a locale, 9:30:00 AM in en.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
epochMs | number |
locale | string |
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”CalendarBackend.formatTimeOfDay
localMidnight()
Section titled “localMidnight()”localMidnight( year, month0, day): number;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:259
Local midnight on a calendar date, in epoch milliseconds.
Fields overflow the way Date’s do (month 12 is January of the next
year, day 0 the last day of the month before), which is what a caller
checking for a rolled-over literal relies on: build the date, read its
fields back, and a 30 February shows up as 1 or 2 March.
The year is taken as written, astronomically: 26 is 26 AD and 0 is 1 BC.
The Date constructor’s reading of 0 to 99 as the 1900s is not part of
the contract, because every year a caller passes is one read off a date
or written out in full (#823). The same holds for localWallClock.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
year | number |
month0 | number |
day | number |
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”localWallClock()
Section titled “localWallClock()”localWallClock( year, month0, day, minutesPastMidnight): number;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:263
A wall-clock time on a calendar date, given as minutes past local midnight, in epoch milliseconds.
The minutes name a clock reading, not an elapsed span: 540 minutes is 09:00 on that date even on a day with a daylight-saving transition, where 540 minutes of elapsed time from midnight would land at 10:00 or 08:00.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
year | number |
month0 | number |
day | number |
minutesPastMidnight | number |
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”CalendarBackend.localWallClock
now(): number;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:239
The current instant, in epoch milliseconds. Read at evaluation time, never baked into bytecode.
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”parseIso8601()
Section titled “parseIso8601()”parseIso8601(text): number;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:308
Parse an ISO 8601 date or date-time string to epoch milliseconds, or
NaN when it names no instant.
A date-only string (2019-04-01) is UTC midnight; a date-time with no
offset and no Z is local time. Both readings are the ECMAScript ones,
and every backend reproduces them so the two spellings of a literal keep
meaning the same instant whichever backend is in use.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text | string |
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”utcOffsetMinutes()
Section titled “utcOffsetMinutes()”utcOffsetMinutes(epochMs): number;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:298
The local zone’s offset from UTC at an instant, in minutes, positive when ahead of UTC.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
epochMs | number |
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”CalendarBackend.utcOffsetMinutes
zone()
Section titled “zone()”zone(): string;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:396
The IANA zone this backend computes in, which is what CalendarBackend.zone documents.
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”zoneOffsetMinutes()
Section titled “zoneOffsetMinutes()”zoneOffsetMinutes(zone, epochMs): number;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:375
A named IANA zone’s offset from UTC at an instant, in minutes, positive
when ahead of UTC. Throws the runtime’s RangeError for a zone it does
not know or an instant it cannot represent.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
zone | string |
epochMs | number |
Returns
Section titled “Returns”number