Documentation

Std.Time.Zoned.Database.TZdb

Represents a Time Zone Database (TZdb) configuration with paths to local and general timezone data.

Instances For

    Parses binary timezone data into zone rules based on a given timezone ID.

    Instances For

      Reads a TZif file from disk and retrieves the zone rules for the specified timezone ID.

      Instances For

        Extracts a timezone ID from a file path.

        Instances For

          Retrieves the timezone rules from the local timezone data file.

          Instances For

            Reads timezone rules from disk based on the provided file path and timezone ID.

            Instances For

              Parsed form of the TZ environment variable.

              The POSIX proleptic format (e.g. TZ=EST5EDT,M3.2.0,M11.1.0) is not supported; only file paths and timezone IDs backed by zoneinfo data are recognized.

              • filePath (p : String) : TZSpec

                A file path (the part after the leading :), absolute or relative to a zoneinfo directory.

              • zoneId (id : String) : TZSpec

                A timezone ID such as America/New_York, looked up in the zoneinfo search paths.

              Instances For
                @[implicit_reducible]

                Parses the value of the TZ environment variable. Returns none for empty or : (empty path after the colon) values.

                Instances For

                  Returns the first path in searchPaths joined with rel that exists on disk, or none.

                  Instances For

                    Resolves the local timezone file path from the TZ environment variable, searching zonesPaths for relative paths and timezone IDs. Falls back to /etc/localtime if TZ is unset. Throws if TZ is set but its value cannot be found on disk.

                    Instances For

                      Returns a TZdb with common fallback zoneinfo paths for Linux and macOS. Call this once at program startup. The TZ and TZDIR environment variables are re-read on every getLocalZoneRules/getZoneRules call, so runtime changes to those variables are always reflected.

                      Instances For

                        Builds the effective zoneinfo search path by prepending the current TZDIR (if set and exists on disk) to db.zonesPaths. Called on every lookup so that runtime changes to TZDIR are reflected immediately.

                        Instances For

                          Retrieves the timezone rules for the local timezone, re-reading the TZ and TZDIR environment variables on each call so that runtime changes are reflected immediately.

                          Instances For

                            Retrieves the timezone rules for the given timezone ID, re-reading TZDIR on each call so that runtime changes are reflected immediately.

                            Instances For
                              @[implicit_reducible]