Skip to content

🧲 Core Getters

The Tempo class provides an extensive array of zero-cost getters that allow you to seamlessly read properties from the underlying Temporal instance.

TIP

Zero-Cost Lazy Evaluation
Tempo uses a sophisticated proxy-based lazy-evaluation pattern. Accessing a getter (like t.yy) resolves the property on demand, and then overwrites the getter with a static literal. This means the first access is O(1) and every subsequent access is raw property access (O(0) cost).

📅 Date Properties

GetterTypeDescriptionExample
.yynumber4-digit Year2026
.mmnumberMonth number (1 = Jan, 12 = Dec)10
.ddnumberDay of the month (1-31)24
.daynumberAlias for .dd24
.erastringLocalized era string'ce', 'bce', 'ad', 'bc'
.eonnumberPositive integer year within the current .era2026, 4

⏱️ Time Properties

GetterTypeDescriptionExample
.hhnumberHour of the day (0-23)15
.minumberMinutes of the hour (0-59)30
.ssnumberSeconds of the minute (0-59)45
.msnumberMilliseconds of the second (0-999)123
.usnumberMicroseconds of the millisecond (0-999)456
.nsnumberNanoseconds of the microsecond (0-999)789
.ffnumberFractional seconds representation0.123456789

🗓️ ISO Week & Day Alignments

GetterTypeDescriptionExample
.ywnumber4-digit ISO week-numbering year2026
.wynumberISO week number of the year (1-53)43
.downumberISO weekday number (1 = Mon, 7 = Sun)6

🔤 Named String Representations

GetterTypeDescriptionExample
.monstringFull English month name'October'
.mmmstringShort English month name'Oct'
.wkdstringFull English weekday name'Saturday'
.wwwstringShort English weekday name'Sat'

🌍 Timezone & System Properties

GetterTypeDescriptionExample
.tzstringIANA Time Zone ID'Australia/Sydney'
.calstringTemporal Calendar ID'iso8601'
.tsnumberUnix timestamp (precision based on config)1792843200000
.nanobigintNanoseconds since Unix epoch1792843200000000000n
.isostringStandard ISO 8601 string (RFC 3339) in UTC'2026-10-24T04:30:00Z'
.isValidbooleantrue if the underlying date-time is validtrue

🎛️ Metadata Properties

Beyond date-time properties, the Tempo class also provides read-only getters into its active state and configuration.

GetterTypeDescription
.configobjectReturns a proxy to the active configuration, including all resolved inheritance and local overrides.
.termsobjectReturns a dictionary of all registered TermPlugins and their available ranges.
.rangesobjectReturns a dictionary of the currently active range key for every registered term (e.g., { 'season': 'summer' }).
.parseobjectReturns a shadowed view of the internal parsing state (including anchor, mode, and the AST-like match output).

Released under the MIT License.