Skip to content

Documentation / @interstellar-tools/types / TemporalUnitType

Type Alias: TemporalUnitType ​

ts
type TemporalUnitType =
  | 's'
  | 'ms'
  | 'μs'
  | 'ns'
  | 'ps'
  | 'fs'
  | 'as'
  | 'zs'
  | 'ys'
  | 'min'
  | 'h'
  | 'd'
  | 'yr'
  | 'kyr'
  | 'Myr'
  | 'Gyr';

Defined in: temporal.ts:37

Canonical temporal unit symbols for spacetime/physics durations.

Design principles ​

  • Canonical symbols only (no plurals): stable for math and serialization.
  • Durations, not timestamps/"ago" semantics.
  • Days are the SI day: exactly 86 400 s.
  • Years are the Julian year (astronomy) by convention: 365.25 d = 31 557 600 s. This keeps yr/kyr/Myr/Gyr numerically crisp for large-scale calculations.
  • Microseconds use the Unicode micro sign μs. If your environment is ASCII-only, normalize external inputs (e.g. "us" → "μs") before using this type.

Members ​

  • Subsecond SI: ms, μs, ns, ps, fs, as, zs, ys
  • Base SI: s
  • Convenient larger units: min, h, d
  • Astronomical year family (durations): yr, kyr, Myr, Gyr

INFO

If you need to accept user-friendly aliases (e.g. "seconds", "us", "hours"), map them to these canonical symbols in a normalization step outside this type.

See ​