Skip to main content

Module tz

Module tz 

Source
Expand description

Display time zone for *_iso fields (flag --tz, XDG display.tz, fallback UTC). Display timezone for *_iso fields in JSON output.

Precedence (highest to lowest priority):

  1. --tz <IANA> flag passed on the CLI
  2. XDG setting display.tz (config set display.tz America/Sao_Paulo)
  3. Fallback UTC

The timezone is initialized once via init and stored in GLOBAL_TZ (OnceLock). After initialization, format_iso and epoch_to_iso convert timestamps applying the chosen timezone.

Functions§

current_tz
Returns the active timezone.
epoch_to_iso
Converts a Unix epoch (seconds) to an ISO 8601 string with the global timezone.
format_iso
Formats a DateTime<Utc> using the global timezone.
init
Initializes the global timezone.