Skip to main content

Module tz

Module tz 

Source
Expand description

Display time zone for *_iso fields (flag --tz, env SQLITE_GRAPHRAG_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. Env var SQLITE_GRAPHRAG_DISPLAY_TZ
  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.