bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/JavaScript/Objects, Classes, and Advanced Patterns
JavaScript•Objects, Classes, and Advanced Patterns

Temporal Standards

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind Temporal Standards?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Order

Put the learning moves in the order that makes the concept easiest to apply.

The RF 3339 Format
The ISO 8601 Standard
Temporal Standards

Temporal is based on the following standards:

NameDescription
ISO 8601International standard
RFC 3339Internet standard
RFC 9557Temporal standard
ISO DurationISO 8601 duration codes
CalendarsISO 8601 calendar systems

The ISO 8601 Standard

ISO 8601 is the International Standard for representing dates and times.

ISO 8601 is a machine-readable format in the form YYYY-MM-DDThh:mm:ssZ .

It was designed to eliminate confusion caused by regional date variations.

It follows a "largest to smallest" hierarchy (year, month, day, hour, minute, second) which ensures that dates are alphabetically sortable.

ISO 8601 avoids confusion between regional formats like:

  • MM/DD/YYYY (US format)
  • DD/MM/YYYY (European format)

ISO 8601 Strings

An ISO 8601 string represents dates and times in a structured and sortable format:

FormatDescription
YYYYA 4-digit year
MM2-digit month
DD2-digit day
TSeparator for time
hhHour
mmMinute
ssSecond
ZZero (Zulu) time Zone

The RF 3339 Format

RFC 3339 is the Internet Standard for Date and Time Formats.

It is a Subset of ISO 8601 designed for use in Internet protocols.

FeatureDescription
FormatFollows the ISO pattern YYYY-MM-DDThh:mm:ssZ
Time ZonesRequires a Z for time zone UTC or an offset (+05:00)
T SeparatorAllows the "T" separator to be replaced by " " for readability
Web APIsThe default format for timestamps in JSON and RESTful APIs
ProgrammingModern languages have bult-in support like toISOString()

The RFC 9557 Format

RFC 9557 is the primary format used by JavaScript Temporal to represent dates.

FeatureISO 8601RFC 3339RFC 9557
FormatYYYY-MM-DDThh:mm:ssZSameSame
UTC OffsetYesYesYes
IANA ZoneNoNo[America/New_York]
CalendarISO onlyISO only[u-ca=hebrew]
CompabileThe StandardSubset of ISO 8601Extends 3339

RFC 9557 was created because ISO 8601 and RFC 3339 did not contain enough information to determine the geographical time zone or handle future DST (Daylight Saving Time) changes.

ISO 8601 Duration Codes

An ISO 8601 duration represent lengths of time.

It uses a standard format starting with ±P (Period), followed by the structure nYnMnDTnHnMnS .

CodeDescription
±Optional positive/negative duration (default is +).
PDuration designator (for period)
nYNumber of calendar years
nMNumber of calendar months
nWNumber of weeks
nDNumber of calendar days
TTime designator (precedes time components)
nHNumber of hours
nMNumber of minutes
nSNumber of seconds

Syntax

(spaces are added for readability)

±P nY nM nW nD T nH nM nS

Example

Three years, six months, four days, twelve hours, thirty minutes, and five seconds.

P3Y6M4DT12H30M5S

Usage Rules

  • Time Separator If you have hours, minutes, or seconds, you must use the T separator, or the code will be invalid (e.g. PT3H not P3H).
  • Optionality Components are optional, but at least one must be present after P or T.
  • Order The order must be preserved: P-> Y-> M-> W-> D-> T-> H-> M-> S.
  • Decimal fractions You can use decimal points for the smallest unit, like PT0.0021S for 2.1 milliseconds.

Calendar Systems in JavaScript

  • Temporal supports multiple calendar systems
  • The calendars are based on the Unicode CLDR standard
  • They are used with the Intl API .
  • The default is iso8601 .
  • Calendars affect how dates are interpreted and displayed.
  • Use [u-ca=calendar] to specify a calendar.

Supported Calendar Identifiers

Calendar IDNameRegionDescription
iso8601ISO 8601WorldwideThe default calendar used by Temporal
gregoryGregorianWorldwideThe most widely used civil calendar today
buddhistBuddhistThailandA different year numbering system than Gregorian
chineseChineseChinaA lunisolar calendar used for traditional festivals
copticCopticEgyptUsed by the Coptic Orthodox Church
dangiDangiKoreaTraditional Korean lunisolar calendar
ethiopicEthiopicEthiopiaA calendar with 13 months
ethioaaEthiopic AAEthiopiaAlternative Ethiopic era
hebrewHebrewIsraelA lunisolar calendar used in Jewish traditions
indianIndian (Saka)IndiaThe official civil calendar of India
islamicIslamicMiddle EastA lunar calendar used in Islamic countries
islamic-umalquraUmm al-QuraSaudi ArabiaThe official Saudi calendar
japaneseJapaneseJapanBased on imperial eras
persianPersianIranA solar calendar with high accuracy
rocRepublic of ChinaTaiwanUsed in Taiwan (Minguo calendar)

Calendar Systems Explained

A calendar system defines how dates are calculated.

Different cultures use different calendars.

Solar Calendars

Based on the Earth's orbit around the sun.

  • Gregorian
  • ISO 8601
  • Persian

These calendars track seasons accurately.

Lunar Calendars

Based on the phases of the moon.

  • Islamic

Lunar calendars have shorter years.

Lunisolar Calendars

Combine solar and lunar cycles.

  • Chinese
  • Hebrew
  • Dangi

They adjust months to stay aligned with seasons.

Era-Based Calendars

Use eras instead of a continuous year count.

  • Japanese
  • ROC (Taiwan)

Using Calendars in Temporal

The from() method supports calendars using the [u-ca=calendar] syntax or a calendar property in objects.

Temporal.PlainDate.from("2026-05-17[u-ca=japanese]")

Previous

JavaScript Class Inheritance

Next

JavaScript Static Methods