Skip to content

TimeZone ​

TimeZone is a closed enum generated from the checked-in IANA catalog. timeZone accepts an IANA identifier and validates that the runtime database provides it.

timeZone(name: string): Result<TimeZone, TemporalError> returns an Err for an unknown or unavailable IANA zone.

tyrus
import { TemporalError, TimeZone, timeZone } from "tyrus:temporal";

export const example = (): void => {
    const paris: TimeZone = match timeZone("Europe/Paris") { Ok(value) => value, Err(error) => { printError(error.code); return; } };
    const saoPaulo: TimeZone = match timeZone("America/Sao_Paulo") { Ok(value) => value, Err(error) => { printError(error.code); return; } };
};