baml.time._tz_to_instant

(internal) Locates a civil ("wall-clock") reading in an IANA timezone, producing an absolute time. The lookup behind `PlainDateTime.to_zoned`.

Reference version

Signature

function baml.time._tz_to_instant(
timezone: string,
civil_ns: bigint,
disambiguation: string
) -> bigint | null throws baml.errors.Io

(internal) Locates a civil ("wall-clock") reading in an IANA timezone, producing an absolute time. The lookup behind PlainDateTime.to_zoned.

Parameters

  • timezone: an IANA identifier.
  • civil_ns: the wall-clock reading as nanoseconds since 1970-01-01T00:00:00, interpreted as if UTC — the encoding PlainDateTime._nanoseconds uses.
  • disambiguation: "compatible", "earlier" or "later". Any other string is treated as "compatible". "reject" never reaches here: callers implement it by resolving both "earlier" and "later" and requiring them to agree.

Returns

The resolved absolute time as nanoseconds since the Unix epoch, or null if the identifier is unknown to the host's timezone database (callers turn that into baml.time.UnknownTimezoneError).

Throws

  • baml.errors.Io if the reading is outside the year range the host can represent, or the host's timezone database fails to resolve it.

Panics

  • baml.panics.HostUnavailable if timezone data is unavailable.

Source:<builtin>/baml/ns_time/timezone.bamlbytes 10813–10970