bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Learn/JavaScript/Objects, Classes, and Advanced Patterns
JavaScript•Objects, Classes, and Advanced Patterns

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

This chapter

Overview
123

Lessons

539m

Read time

1. JavaScript Objects2. JavaScript Temporal Tutorial3. JavaScript Loops4. JavaScript Advanced Functions5. JavaScript Objects6. JavaScript Temporal Intro7. JavaScript Iterables8. JavaScript Function Definitions9. JavaScript Object Properties10. JavaScript Temporal vs Date11. JavaScript Iterators12. JavaScript Callbacks13. JavaScript Object Methods14. JavaScript Temporal Duration15. JavaScript Generators16. The JavaScript this Keyword17. JavaScript this Keyword18. JavaScript Temporal Instant19. JavaScript Function call()20. JavaScript Display Objects21. JavaScript PlainDateTime22. JavaScript Function apply()23. JavaScript Object Constructors24. JavaScript Temporal PlainDate25. JavaScript Function bind()26. JavaScript PlainYearMonth27. Self-Invoking Functions28. JavaScript PlainMonthDay29. JavaScript Closures30. JavaScript Temporal PlainTime31. JavaScript Objects - Advanced32. JavaScript ZonedDateTime33. JavaScript Object Definitions34. JavaScript Temporal Now35. this in JavaScript Objects36. JS Temporal Arithmetic37. JavaScript Object Iterations38. JS Temporal Differences39. JavaScript Object Accessors40. JS Temporal Compare41. JavaScript Object Management42. JavaScript Temporal Conversion43. JavaScript Object Protection44. Temporal Display Formats45. JavaScript Object Prototypes46. JavaScript Temporal Mistakes47. JavaScript Classes48. Migrate from Date to Temporal49. JavaScript Class Inheritance50. Temporal Standards51. JavaScript Static Methods52. Asynchronous JavaScript53. Asynchronous Programming54. JavaScript Timeouts55. JavaScript Callbacks56. JavaScript Promises57. JavaScript async and await58. JavaScript fetch API59. Debugging Async JavaScript60. JavaScript Modules61. JavaScript Modules Export62. JavaScript Modules Import63. JS Module Namespace64. JavaScript Dynamic Modules65. JavaScript Meta Programming66. JavaScript Reflect67. JavaScript Proxy68. JavaScript Typed Arrays69. Typed Array Methods70. JavaScript ArrayBuffer71. JavaScript DataView72. JavaScript Atomics73. JavaScript HTML DOM Navigation74. JavaScript HTML DOM Elements (Nodes)75. JavaScript HTML DOM Collections76. JavaScript HTML DOM Node Lists77. JavaScript Window - The Browser Object Model78. JavaScript Window Screen79. JavaScript Window Location80. JavaScript Window History81. JavaScript Window Navigator82. JavaScript Popup Boxes83. JavaScript Timing Events84. JavaScript Cookies85. Web APIs - Introduction86. JavaScript Fetch API87. Web Geolocation API88. Web History API89. Pointer Events API90. Web Storage API91. JavaScript Validation API92. Web Workers API93. AJAX Introduction94. AJAX - The XMLHttpRequest Object95. AJAX - XMLHttpRequest96. AJAX - Server Response97. AJAX XML Example98. AJAX PHP Example99. AJAX ASP Example100. AJAX Database Example101. XML Applications102. JavaScript JSON103. JSON Syntax104. JSON vs XML105. JSON Data Types106. JSON.parse()107. JSON.stringify()108. JSON Object Literals109. JSON Array Literals110. JSON PHP111. JSON HTML112. JSONP113. JavaScript / jQuery DOM Selectors114. JavaScript / jQuery HTML Elements115. JavaScript / jQuery CSS Styles116. JavaScript / jQuery HTML DOM117. JavaScript Graphics118. HTML Canvas119. Plotly.js120. Chart.js121. Google Chart122. D3.js123. JavaScript Interview Preparation

On this page

The ISO 8601 StandardISO 8601 StringsThe RF 3339 FormatThe RFC 9557 FormatISO 8601 Duration CodesUsage RulesCalendar Systems in JavaScriptSupported Calendar IdentifiersCalendar Systems ExplainedSolar CalendarsLunar CalendarsLunisolar CalendarsEra-Based CalendarsUsing Calendars in Temporal