Skip to content

Documentation / @interstellar-tools/types / TemporalUnitAliasType

Type Alias: TemporalUnitAliasType ​

ts
type TemporalUnitAliasType =
  | 'second'
  | 'seconds'
  | 'millisecond'
  | 'milliseconds'
  | 'microsecond'
  | 'microseconds'
  | 'us'
  | 'minute'
  | 'minutes'
  | 'hour'
  | 'hours'
  | 'day'
  | 'days'
  | 'year'
  | 'years'
  | 'yr'
  | 'yrs'
  | 'kiloyear'
  | 'kiloyears'
  | 'kyr'
  | 'megayear'
  | 'megayears'
  | 'megaannum'
  | 'megaannums'
  | 'Myr'
  | 'Ma'
  | 'gigayear'
  | 'gigayears'
  | 'gigaannum'
  | 'gigaannums'
  | 'Gyr'
  | 'Ga';

Defined in: temporal.ts:84

Human-friendly temporal unit aliases accepted at input time.

These strings could be parsed and normalized to your canonical TemporalUnitType (e.g., "seconds" → "s", "us" → "μs", "megayears" → "Myr").

Scope & conventions ​

  • Durations only (not timestamps or "ago" semantics).
  • Day is the SI day: exactly 86 400 s.
  • Year-family (yr, kyr, Myr, Gyr) is based on the Julian year (365.25 d = 31 557 600 s) for stable large-scale calculations.
  • ASCII micro: "us" is accepted and normalized to "μs".
  • Geology-style tokens (Ma, Ga, megaannum, gigaannum) are accepted but normalized to Myr/Gyr as durations (not "million years ago").
  • Case-sensitive: tokens are matched exactly as listed.
  1. Accept TemporalUnitAliasType from users/IO.
  2. Normalize to TemporalUnitType.
  3. Use only canonical units for arithmetic, storage, and serialization.

See ​