Tempo API
    Preparing search index...

    Class Tempo

    A powerful wrapper around Temporal.ZonedDateTime for flexible parsing and intuitive manipulation of date-time objects. Bridges the gap between raw string/number inputs and the strict requirements of the ECMAScript Temporal API.

    Index
    • Instantiates a new Tempo object with configuration only.

      Parameters

      • Optionaloptions: Options

        Configuration options for this specific instance.

      Returns Tempo

    • Instantiates a new Tempo object with a value.

      Parameters

      • tempo: DateTime

        The date-time value to parse.

      • Optionaloptions: Options

        Configuration options for this specific instance.

      Returns Tempo

    Interval: new (start: DateTime, end: DateTime) => Interval<Tempo> = ...

    Interval class for checking overlaps and bounds between Temporal points

    • get epoch(): Readonly<{ ms: number; ns: bigint; ss: number; us: number }>

      units since epoch for this date-time instance

      Returns Readonly<{ ms: number; ns: bigint; ss: number; us: number }>

    • get eraYear(): number | undefined

      Year within the era (positive integer).

      Returns number | undefined

      Use eon (Tempo canonical) or zdt.eraYear instead. To be removed in v5.0.0.

    • get fmt(): Record<string, string | undefined>

      Formatted results for all pre-defined format codes

      Returns Record<string, string | undefined>

    • get geo(): Readonly<GeoConfig> | undefined

      Resolved geographic coordinates object ({ latitude, longitude, ... })

      Returns Readonly<GeoConfig> | undefined

    • get intl(): ResolvedLocaleInfo

      Resolved cultural and regional locale information (firstDay, weekend, direction, etc.) via Intl.LocaleInfo

      Returns ResolvedLocaleInfo

    • get mmm(): | "All"
      | "Jan"
      | "Feb"
      | "Mar"
      | "Apr"
      | "May"
      | "Jun"
      | "Jul"
      | "Aug"
      | "Sep"
      | "Oct"
      | "Nov"
      | "Dec"

      Short month name (e.g., 'Jan')

      Returns
          | "All"
          | "Jan"
          | "Feb"
          | "Mar"
          | "Apr"
          | "May"
          | "Jun"
          | "Jul"
          | "Aug"
          | "Sep"
          | "Oct"
          | "Nov"
          | "Dec"

    • get mon(): | "May"
      | "Every"
      | "January"
      | "February"
      | "March"
      | "April"
      | "June"
      | "July"
      | "August"
      | "September"
      | "October"
      | "November"
      | "December"

      Full month name (e.g., 'January')

      Returns
          | "May"
          | "Every"
          | "January"
          | "February"
          | "March"
          | "April"
          | "June"
          | "July"
          | "August"
          | "September"
          | "October"
          | "November"
          | "December"

    • get terms(): Readonly<Record<string, readonly string[]>>

      list of registered terms and their available range keys

      Returns Readonly<Record<string, readonly string[]>>

    • get wkd(): | "Everyday"
      | "Monday"
      | "Tuesday"
      | "Wednesday"
      | "Thursday"
      | "Friday"
      | "Saturday"
      | "Sunday"

      Full weekday name (e.g., 'Monday')

      Returns
          | "Everyday"
          | "Monday"
          | "Tuesday"
          | "Wednesday"
          | "Thursday"
          | "Friday"
          | "Saturday"
          | "Sunday"

    • get ww(): wy

      ISO week number of the year.

      Returns wy

      Use wy (Tempo canonical) or zdt.weekOfYear instead. To be removed in v5.0.0.

    • get www(): "All" | "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun"

      Short weekday name (e.g., 'Mon')

      Returns "All" | "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun"

    • get cache(): SecureObject<
          {
              clear(count?: number): void;
              delete(key: string): boolean;
              deletePrefix(prefix: string): number;
              entries(): MapIterator<[string, string]>;
              fromEntries(
                  entries: Iterable<readonly [string, string]>,
              ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 5 more ...; readonly toJSON: () => Record<...>; };
              get(key: string): string | undefined;
              has(key: string): boolean;
              set(
                  key: string,
                  value: string,
              ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 5 more ...; readonly toJSON: () => Record<...>; };
              setStatic(
                  key: string,
                  value: string,
              ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 5 more ...; readonly toJSON: () => Record<...>; };
              toJSON(): Record<string, string>;
          },
      >

      high-performance in-memory cache facade for glossary and dynamic parse results

      Returns SecureObject<
          {
              clear(count?: number): void;
              delete(key: string): boolean;
              deletePrefix(prefix: string): number;
              entries(): MapIterator<[string, string]>;
              fromEntries(
                  entries: Iterable<readonly [string, string]>,
              ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 5 more ...; readonly toJSON: () => Record<...>; };
              get(key: string): string | undefined;
              has(key: string): boolean;
              set(
                  key: string,
                  value: string,
              ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 5 more ...; readonly toJSON: () => Record<...>; };
              setStatic(
                  key: string,
                  value: string,
              ): { readonly get: (key: string) => string | undefined; readonly has: (key: string) => boolean; readonly set: (key: string, value: string) => ...; readonly setStatic: (key: string, value: string) => ...; ... 5 more ...; readonly toJSON: () => Record<...>; };
              toJSON(): Record<string, string>;
          },
      >

    • get CACHE(): EnumifyType<{ Off: false; On: true; Refresh: "refresh" }>

      cache operation modes

      Returns EnumifyType<{ Off: false; On: true; Refresh: "refresh" }>

    • get epoch(): Readonly<{ ms: number; ns: bigint; ss: number; us: number }>

      static units since Unix epoch

      Returns Readonly<{ ms: number; ns: bigint; ss: number; us: number }>

    • get FORMAT(): Extend<
          EnumifyType<
              {
                  date: "{yyyy}-{mm}-{dd}";
                  dayDate: "{dd}-{mmm}-{yyyy}";
                  dayMonth: "{dd}-{mmm}";
                  dayTime: "{dd}-{mmm}-{yyyy} {hh}:{mi}:{ss}";
                  display: "{www}, {dd} {mmm} {yyyy}";
                  logStamp: "{ymd}T{hms}.{ff}";
                  sortTime: "{yyyy}-{mm}-{dd} {hh}:{mi}:{ss}";
                  time: "{hh}:{mi}:{ss}";
                  weekDate: "{www}, {yyyy}-{mmm}-{dd}";
                  weekStamp: "{www}, {yyyy}-{mmm}-{dd} {hh}:{mi}:{ss}.{ff}";
                  weekTime: "{www}, {yyyy}-{mmm}-{dd} {hh}:{mi}:{ss}";
                  yearMonth: "{yyyy}{mm}";
                  yearMonthDay: "{ymd}";
                  yearWeek: "{yw}{wy}";
              },
          >,
          string,
          string,
      >

      Pre-configured format {name -> string} pairs

      Returns Extend<
          EnumifyType<
              {
                  date: "{yyyy}-{mm}-{dd}";
                  dayDate: "{dd}-{mmm}-{yyyy}";
                  dayMonth: "{dd}-{mmm}";
                  dayTime: "{dd}-{mmm}-{yyyy} {hh}:{mi}:{ss}";
                  display: "{www}, {dd} {mmm} {yyyy}";
                  logStamp: "{ymd}T{hms}.{ff}";
                  sortTime: "{yyyy}-{mm}-{dd} {hh}:{mi}:{ss}";
                  time: "{hh}:{mi}:{ss}";
                  weekDate: "{www}, {yyyy}-{mmm}-{dd}";
                  weekStamp: "{www}, {yyyy}-{mmm}-{dd} {hh}:{mi}:{ss}.{ff}";
                  weekTime: "{www}, {yyyy}-{mmm}-{dd} {hh}:{mi}:{ss}";
                  yearMonth: "{yyyy}{mm}";
                  yearMonthDay: "{ymd}";
                  yearWeek: "{yw}{wy}";
              },
          >,
          string,
          string,
      >

    • get intl(): ResolvedLocaleInfo

      Resolved cultural and regional locale information for the global locale via Intl.LocaleInfo

      Returns ResolvedLocaleInfo

    • get LIMIT(): Readonly<{ get maxTempo(): bigint; get minTempo(): bigint }>

      some useful Dates

      Returns Readonly<{ get maxTempo(): bigint; get minTempo(): bigint }>

    • get MODE(): EnumifyType<{ Auto: "auto"; Defer: "defer"; Strict: "strict" }>

      initialization strategies

      Returns EnumifyType<{ Auto: "auto"; Defer: "defer"; Strict: "strict" }>

    • get MONTH_DAY(): Readonly<
          {
              layouts: readonly [
                  readonly ["dayMonthYearShort", "monthDayYearShort"],
                  readonly ["dayMonthYear", "monthDayYear"],
              ];
              locales: readonly ["en-US", "en-AS"];
              timezones: {
                  "en-AS": readonly ["Pacific/Pago_Pago"];
                  "en-US": readonly [
                      "America/Adak",
                      "America/Anchorage",
                      "America/Boise",
                      "America/Chicago",
                      "America/Denver",
                      "America/Detroit",
                      "America/Indiana/Indianapolis",
                      "America/Indiana/Knox",
                      "America/Indiana/Marengo",
                      "America/Indiana/Petersburg",
                      "America/Indiana/Tell_City",
                      "America/Indiana/Vevay",
                      "America/Indiana/Vincennes",
                      "America/Indiana/Winamac",
                      "America/Indianapolis",
                      "America/Juneau",
                      "America/Kentucky/Louisville",
                      "America/Kentucky/Monticello",
                      "America/Los_Angeles",
                      "America/Louisville",
                      "America/Menominee",
                      "America/Metlakatla",
                      "America/New_York",
                      "America/Nome",
                      "America/North_Dakota/Beulah",
                      "America/North_Dakota/Center",
                      "America/North_Dakota/New_Salem",
                      "America/Phoenix",
                      "America/Sitka",
                      "America/Yakutat",
                      "Pacific/Honolulu",
                      "US/Aleutian",
                      "US/Alaska",
                      "US/Arizona",
                      "US/Central",
                      "US/Eastern",
                      "US/Mountain",
                      "US/Pacific",
                  ];
              };
          },
      >

      regional date-parsing configuration

      Returns Readonly<
          {
              layouts: readonly [
                  readonly ["dayMonthYearShort", "monthDayYearShort"],
                  readonly ["dayMonthYear", "monthDayYear"],
              ];
              locales: readonly ["en-US", "en-AS"];
              timezones: {
                  "en-AS": readonly ["Pacific/Pago_Pago"];
                  "en-US": readonly [
                      "America/Adak",
                      "America/Anchorage",
                      "America/Boise",
                      "America/Chicago",
                      "America/Denver",
                      "America/Detroit",
                      "America/Indiana/Indianapolis",
                      "America/Indiana/Knox",
                      "America/Indiana/Marengo",
                      "America/Indiana/Petersburg",
                      "America/Indiana/Tell_City",
                      "America/Indiana/Vevay",
                      "America/Indiana/Vincennes",
                      "America/Indiana/Winamac",
                      "America/Indianapolis",
                      "America/Juneau",
                      "America/Kentucky/Louisville",
                      "America/Kentucky/Monticello",
                      "America/Los_Angeles",
                      "America/Louisville",
                      "America/Menominee",
                      "America/Metlakatla",
                      "America/New_York",
                      "America/Nome",
                      "America/North_Dakota/Beulah",
                      "America/North_Dakota/Center",
                      "America/North_Dakota/New_Salem",
                      "America/Phoenix",
                      "America/Sitka",
                      "America/Yakutat",
                      "Pacific/Honolulu",
                      "US/Aleutian",
                      "US/Alaska",
                      "US/Arizona",
                      "US/Central",
                      "US/Eastern",
                      "US/Mountain",
                      "US/Pacific",
                  ];
              };
          },
      >

    • get NUMBER(): Extend<
          EnumifyType<
              {
                  eight: 8;
                  five: 5;
                  four: 4;
                  nine: 9;
                  one: 1;
                  seven: 7;
                  six: 6;
                  ten: 10;
                  three: 3;
                  two: 2;
                  zero: 0;
              },
          >,
          string,
          number,
      >

      Number names (0-10)

      Returns Extend<
          EnumifyType<
              {
                  eight: 8;
                  five: 5;
                  four: 4;
                  nine: 9;
                  one: 1;
                  seven: 7;
                  six: 6;
                  ten: 10;
                  three: 3;
                  two: 2;
                  zero: 0;
              },
          >,
          string,
          number,
      >

    • get options(): any

      Retrieves the merged options for this Tempo class, combining defaults, storage, discovery, and config.

      Returns any

      The complete options object for Tempo initialization

    • get parse(): SecureObject<
          {
              anchor?: ZonedDateTime;
              event: {
                  christmas: "25 Dec";
                  "christmas ?eve": "24 Dec";
                  fortnight: (this: AliasContext) => AliasContext;
                  "new.?years? ?eve": "31 Dec";
                  "new.?years?(?: ?day)?": "01 Jan";
                  now: (this: AliasContext) => AliasContext;
                  ny: "01 Jan";
                  nye: "31 Dec";
                  today: (this: AliasContext) => ZonedDateTime;
                  tomorrow: (this: AliasContext) => AliasContext;
                  xmas: "25 Dec";
                  "xmas ?eve": "24 Dec";
                  yesterday: (this: AliasContext) => AliasContext;
                  readonly [key: string]: string | Function;
              };
              ignore: { readonly [key: string]: string };
              isAnchored?: boolean;
              layout: { readonly [key: symbol]: string };
              mode: "auto" | "strict" | "defer";
              monthDay: MonthDay;
              pattern: Registry;
              period: {
                  "after[ -]?noon": "3:00pm";
                  evening: "18:00";
                  "half[ -]?hour": (this: AliasContext) => string;
                  "mid[ -]?day": "12:00";
                  "mid[ -]?morning": "10:00";
                  "mid[ -]?night": "24:00";
                  morning: "8:00";
                  night: "20:00";
                  noon: "12:00";
                  readonly [key: string]: string | Function;
              };
              pivot: number;
              planner: { layoutOrder: (string | symbol)[]; preFilter: boolean };
              result: Match[];
              snippet: { readonly [key: symbol]: RegExp };
              token: Extend;
          },
      >

      configuration governing the static 'rules' used when parsing t.DateTime argument

      Returns SecureObject<
          {
              anchor?: ZonedDateTime;
              event: {
                  christmas: "25 Dec";
                  "christmas ?eve": "24 Dec";
                  fortnight: (this: AliasContext) => AliasContext;
                  "new.?years? ?eve": "31 Dec";
                  "new.?years?(?: ?day)?": "01 Jan";
                  now: (this: AliasContext) => AliasContext;
                  ny: "01 Jan";
                  nye: "31 Dec";
                  today: (this: AliasContext) => ZonedDateTime;
                  tomorrow: (this: AliasContext) => AliasContext;
                  xmas: "25 Dec";
                  "xmas ?eve": "24 Dec";
                  yesterday: (this: AliasContext) => AliasContext;
                  readonly [key: string]: string | Function;
              };
              ignore: { readonly [key: string]: string };
              isAnchored?: boolean;
              layout: { readonly [key: symbol]: string };
              mode: "auto" | "strict" | "defer";
              monthDay: MonthDay;
              pattern: Registry;
              period: {
                  "after[ -]?noon": "3:00pm";
                  evening: "18:00";
                  "half[ -]?hour": (this: AliasContext) => string;
                  "mid[ -]?day": "12:00";
                  "mid[ -]?morning": "10:00";
                  "mid[ -]?night": "24:00";
                  morning: "8:00";
                  night: "20:00";
                  noon: "12:00";
                  readonly [key: string]: string | Function;
              };
              pivot: number;
              planner: { layoutOrder: (string | symbol)[]; preFilter: boolean };
              result: Match[];
              snippet: { readonly [key: symbol]: RegExp };
              token: Extend;
          },
      >

    • get registry(): Readonly<
          {
              formats: EnumifyType;
              locales: Readonly<
                  Record<string, Readonly<Record<string, string | Function>>>,
              >;
              modifiers?: Readonly<Record<string, string | readonly string[]>>;
              numbers?: Readonly<Record<string, number>>;
              tokens?: Readonly<Record<string, TokenEvaluator>>;
          },
      >

      static Tempo.registry

      Returns Readonly<
          {
              formats: EnumifyType;
              locales: Readonly<
                  Record<string, Readonly<Record<string, string | Function>>>,
              >;
              modifiers?: Readonly<Record<string, string | readonly string[]>>;
              numbers?: Readonly<Record<string, number>>;
              tokens?: Readonly<Record<string, TokenEvaluator>>;
          },
      >

    • get TIMEZONE(): Extend<
          Readonly<
              {
                  acdt: "Australia/Adelaide";
                  acst: "Australia/Adelaide";
                  aedt: "Australia/Sydney";
                  aest: "Australia/Sydney";
                  awst: "Australia/Perth";
                  cdt: "America/Chicago";
                  cest: "Europe/Paris";
                  cet: "Europe/Paris";
                  cst: "America/Chicago";
                  edt: "America/New_York";
                  eest: "Europe/Helsinki";
                  eet: "Europe/Helsinki";
                  est: "America/New_York";
                  gmt: "UTC";
                  ist: "Asia/Kolkata";
                  jst: "Asia/Tokyo";
                  mdt: "America/Denver";
                  mst: "America/Denver";
                  npt: "Asia/Kathmandu";
                  nzdt: "Pacific/Auckland";
                  nzst: "Pacific/Auckland";
                  nzt: "Pacific/Auckland";
                  pdt: "America/Los_Angeles";
                  pst: "America/Los_Angeles";
                  utc: "UTC";
              },
          >,
          string,
          string,
      >

      TimeZone aliases

      Returns Extend<
          Readonly<
              {
                  acdt: "Australia/Adelaide";
                  acst: "Australia/Adelaide";
                  aedt: "Australia/Sydney";
                  aest: "Australia/Sydney";
                  awst: "Australia/Perth";
                  cdt: "America/Chicago";
                  cest: "Europe/Paris";
                  cet: "Europe/Paris";
                  cst: "America/Chicago";
                  edt: "America/New_York";
                  eest: "Europe/Helsinki";
                  eet: "Europe/Helsinki";
                  est: "America/New_York";
                  gmt: "UTC";
                  ist: "Asia/Kolkata";
                  jst: "Asia/Tokyo";
                  mdt: "America/Denver";
                  mst: "America/Denver";
                  npt: "Asia/Kathmandu";
                  nzdt: "Pacific/Auckland";
                  nzst: "Pacific/Auckland";
                  nzt: "Pacific/Auckland";
                  pdt: "America/Los_Angeles";
                  pst: "America/Los_Angeles";
                  utc: "UTC";
              },
          >,
          string,
          string,
      >

    • get versions(): Readonly<Record<string, string>>

      the active versions of Tempo and any registered plugins or modules

      Returns Readonly<Record<string, string>>

    • iterate over instance formats

      Returns ArrayIterator<EntryOf<Record<string, string | undefined>>>

    • allow for auto-convert of Tempo to BigInt, Number or String

      Parameters

      • Optionalhint: "string" | "number" | "default"

      Returns string | number | bigint

    • apply a custom format.

      Parameters

      • Optionalfmt: any
      • Optionaloptions: any

      Returns string

    • applies a format to the instance.

      Parameters

      • options: FormatOptions

      Returns string

    • Applies a format to the instance. Format strings are validated at compile time — any unrecognised {token} will produce an IDE error showing the bad token name.

      Type Parameters

      • S extends string

      Parameters

      • fmt: string extends S ? S : string extends ValidateFormat<S> ? S : ValidateFormat<S>
      • Optionaloptions: any

      Returns string

      TempoFormatTokens to extend the token set.

    • applies a format to the instance (zero-argument — returns a pre-built format proxy).

      Returns string

    • Computes the next occurrence of a recurrence rule (RRULE string) after this instant.

      Parameters

      • rrule: string | { rrule: string }

        The RFC 5545 RRULE string or object with an rrule property

      Returns Tempo | null

      A new Tempo instance at the next occurrence, or null if no further occurrences exist

    • time elapsed since another date-time

      Parameters

      • OptionaldateTimeOrOpts: Options | DateTime
      • Optionalopts: Options

      Returns Duration

    • time elapsed since another date-time

      Parameters

      • unit: Unit
      • Optionalopts: Options

      Returns number

    • time elapsed since another date-time

      Parameters

      • dateTimeOrOpts: Options | DateTime
      • unit: Unit

      Returns number

    • time elapsed since (with unit)

      Parameters

      • until: Until
      • Optionalopts: Options

      Returns string

    • time elapsed since another date-time (with unit)

      Parameters

      • dateTimeOrOpts: Options | DateTime
      • until: Until

      Returns string

    • time elapsed since another date-time (w'out unit)

      Parameters

      • OptionaldateTimeOrOpts: Options | DateTime
      • Optionalopts: Options

      Returns string

    • time elapsed since another date-time

      Parameters

      • OptionaloptsOrDate: any
      • OptionaloptsOrUntil: any

      Returns string

    • Custom JSON serialization for JSON.stringify.

      Returns {
          calendar: CalendarLike;
          catch?: boolean;
          debug?: DebugLevel;
          discovery?: string | symbol | Discovery;
          geo?: Readonly<GeoConfig>;
          intl?: Readonly<IntlOptions>;
          locale: string | readonly string[];
          localeInfo?: boolean;
          mode?: "auto" | "strict" | "defer";
          planner?: Readonly<PlannerOptions>;
          pluginOptions?: Record<string, any>;
          plugins?: any;
          registry: Readonly<
              {
                  formats: FormatRegistry;
                  locales: Readonly<
                      Record<string, Readonly<Record<string, string | Function>>>,
                  >;
                  modifiers?: Readonly<Record<string, string | readonly string[]>>;
                  numbers?: Readonly<Record<string, number>>;
                  tokens?: Readonly<Record<string, TokenEvaluator>>;
              },
          >;
          scope: "global"
          | "local";
          silent?: boolean;
          sphere: string | undefined;
          store?: string;
          timeStamp?: TimeStamp;
          timeZone: TimeZoneLike;
          value: string;
      }

      • Readonlycalendar: CalendarLike

        Temporal calendar

      • Optionalcatch?: boolean

        catch or throw Errors

      • Optionaldebug?: DebugLevel

        additional console.log for tracking

      • Optionaldiscovery?: string | symbol | Discovery

        globalThis Discovery Symbol

      • Optional Readonlygeo?: Readonly<GeoConfig>

        Geolocation coordinates configuration

      • Optional Readonlyintl?: Readonly<IntlOptions>

        internationalization configuration (relativeTime, etc.)

      • Readonlylocale: string | readonly string[]

        locale (e.g. en-AU)

      • OptionallocaleInfo?: boolean

        enable regional calendar boundaries (week start/end/mid) via Intl.LocaleInfo

      • Optionalmode?: "auto" | "strict" | "defer"

        initialization strategy ('auto'|'strict'|'defer')

      • Optional Readonlyplanner?: Readonly<PlannerOptions>

        parse planner configuration (layoutOrder, etc.)

      • OptionalpluginOptions?: Record<string, any>

        Plugin configuration defaults and dictionaries keyed by plugin name

      • Optionalplugins?: any

        Plugins or terms to extend onto Tempo.

        To provide configuration options or defaults for plugins, use pluginOptions instead.

      • Readonlyregistry: Readonly<
            {
                formats: FormatRegistry;
                locales: Readonly<
                    Record<string, Readonly<Record<string, string | Function>>>,
                >;
                modifiers?: Readonly<Record<string, string | readonly string[]>>;
                numbers?: Readonly<Record<string, number>>;
                tokens?: Readonly<Record<string, TokenEvaluator>>;
            },
        >

        custom data augmentation registries

      • Readonlyscope: "global" | "local"

        scope for configuration mutations

      • Optionalsilent?: boolean

        suppress console output during catch

      • Readonlysphere: string | undefined

        hemisphere for term.qtr or term.szn

      • Optionalstore?: string

        localStorage key

      • OptionaltimeStamp?: TimeStamp

        Precision to measure timestamps (ms | us)

      • ReadonlytimeZone: TimeZoneLike

        Temporal timeZone

      • value: string
    • time duration until another date-time

      Parameters

      • OptionaldateTimeOrOpts: Options | DateTime
      • Optionalopts: Options

      Returns Duration

    • time duration until another date-time

      Parameters

      • unit: Unit
      • Optionalopts: Options

      Returns number

    • time duration until another date-time

      Parameters

      • dateTimeOrOpts: Options | DateTime
      • unit: Unit

      Returns number

    • time duration until (returns Duration)

      Parameters

      • OptionaldateTimeOrOpts: Options | DateTime
      • Optionalopts: Options

      Returns Duration

    • time duration until (with unit, returns number)

      Parameters

      • unit: Unit
      • Optionalopts: Options

      Returns number

    • time duration until another date-time (with unit)

      Parameters

      • dateTimeOrOpts: Options | DateTime
      • unit: Unit

      Returns number

    • fallback: union of possible returns

      Parameters

      • OptionaloptsOrDate:
            | string
            | number
            | bigint
            | TempoBrand
            | ZonedDateTime
            | Instant
            | Options
            | PlainDate
            | PlainDateTime
            | PlainMonthDay
            | PlainYearMonth
            | Date
            | ZonedDateTimeLikeObject
            | ISOString
            | Tempo
            | PlainTime
            | Duration
            | DurationLikeObject
            | Options & { unit?: Unit }
            | null
      • OptionaloptsOrUntil: Options | Until

      Returns number | Duration

    • Checks if an instance is a Tempo object using the brand symbol. Allows instanceof to work across module boundaries.

      Parameters

      • instance: any

        The instance to check

      Returns boolean

      True if the instance is a Tempo object

    • Automatically discovers and loads configuration from tempo.config.* before initializing the engine.

      Parameters

      • Optionaloptions: { configFile?: string; cwd?: string }

      Returns Promise<typeof Tempo>

    • Compares two Tempo instances or date-time values. Returns -1 (earlier), 0 (equal), or 1 (later).

      Parameters

      • Optionaltempo1: Options | DateTime
      • Optionaltempo2: Options | DateTime

      Returns number

    • 🏭 Sandbox Factory & Scoped Execution Mode

      1. Factory Mode: Creates a fresh, isolated Tempo subclass with its own configuration and registries. The returned class implements Disposable ([Symbol.dispose]()), allowing deterministic cleanup via using.

      2. Scoped Execution Mode: When provided a callback, creates an isolated sandbox, executes the callback, and automatically disposes the sandbox upon completion (supporting both synchronous and Promise returns).

      Parameters

      • Optionaloptions: Options

      Returns typeof Tempo

      // Factory mode with `using`
      {
      using sb = Tempo.create({ discovery: 'test' });
      sb.use(MyPlugin);
      }

      // Scoped callback mode
      const result = Tempo.create((sb) => {
      sb.use(MyPlugin);
      return sb('2026-05-10').format();
      });
    • 🏭 Sandbox Factory & Scoped Execution Mode

      1. Factory Mode: Creates a fresh, isolated Tempo subclass with its own configuration and registries. The returned class implements Disposable ([Symbol.dispose]()), allowing deterministic cleanup via using.

      2. Scoped Execution Mode: When provided a callback, creates an isolated sandbox, executes the callback, and automatically disposes the sandbox upon completion (supporting both synchronous and Promise returns).

      Type Parameters

      • R

      Parameters

      • fn: (sandbox: typeof Tempo) => R

      Returns R

      // Factory mode with `using`
      {
      using sb = Tempo.create({ discovery: 'test' });
      sb.use(MyPlugin);
      }

      // Scoped callback mode
      const result = Tempo.create((sb) => {
      sb.use(MyPlugin);
      return sb('2026-05-10').format();
      });
    • 🏭 Sandbox Factory & Scoped Execution Mode

      1. Factory Mode: Creates a fresh, isolated Tempo subclass with its own configuration and registries. The returned class implements Disposable ([Symbol.dispose]()), allowing deterministic cleanup via using.

      2. Scoped Execution Mode: When provided a callback, creates an isolated sandbox, executes the callback, and automatically disposes the sandbox upon completion (supporting both synchronous and Promise returns).

      Type Parameters

      • R

      Parameters

      • options: Options
      • fn: (sandbox: typeof Tempo) => R

      Returns R

      // Factory mode with `using`
      {
      using sb = Tempo.create({ discovery: 'test' });
      sb.use(MyPlugin);
      }

      // Scoped callback mode
      const result = Tempo.create((sb) => {
      sb.use(MyPlugin);
      return sb('2026-05-10').format();
      });
    • Gets the current timestamp in the specified unit.

      Parameters

      • unit: "ss" | "ms" | "us"

        The time unit ('ss', 'ms', 'us').

      Returns number

      The current timestamp as a number (for 'ss', 'ms', 'us')

    • Gets the current timestamp in the specified unit.

      Parameters

      • Optionalunit: "ns"

        The time unit ('ss', 'ms', 'us', 'ns'). Defaults to 'ns' (nanoseconds).

      Returns bigint

      The current timestamp as a number (for 'ss', 'ms', 'us') or bigint (for 'ns')

    • translates {layout} into an anchored, case-insensitive RegExp.

      Parameters

      • layout: string | RegExp
      • Optionalsnippet: Extend<{ readonly [key: symbol]: RegExp }, symbol, RegExp>

      Returns RegExp

    • Register discovery configuration with an optional discovery symbol.

      Parameters

      • discovery: Discovery

        Discovery object defining options, formats, periods, or terms.

      • Optionalsymbol: symbol

        Optional symbol identifier under globalThis to attach discovery data.

      Returns typeof Tempo

    • Register an individual plugin or plugin factory.

      Type Parameters

      • T extends TempoPlugin = TempoPlugin
      • Opts = any

      Parameters

      • plugin: any

        The plugin function or definition to register.

      • Optionaloptions: Options

        Optional configuration for the plugin.

      Returns typeof Tempo

    • Register an array of plugins, terms, factories, or tuples.

      Parameters

      • plugins: any[]

        An array of plugins, terms, factories, or tuples to register.

      • Optionaloptions: Options

        Optional configuration for the plugins.

      Returns typeof Tempo

    • Register multiple plugins or term extensions.

      Parameters

      • ...args: any[]

        A plugin, term, or list of extensions to register.

      Returns typeof Tempo