Timezone lookup.

Collection Info

View Source
Collection
core
Path
time/timezone
Entries
24

Source Files

(hidden platform specific files)

Constants

3

Types

5

Procedures

16

datetime_to_tz #

Source
datetime_to_tz :: proc(dt: DateTime, tz: ^TZ_Region) -> (out: DateTime, success: bool) #optional_ok {…}

Converts a datetime on one timezone to another timezone Inputs: - dt: The input datetime - tz: The timezone to convert to NOTE: tz will be referenced in the result datetime, so it must stay alive/allocated as long as it is used Returns: - out: The converted datetime - success: `false` if the datetime was invalid

dst #

Source
dst :: proc(dt: DateTime) -> (is_dst: bool, success: bool) #optional_ok {…}

Checks DST for a given date. Inputs: - dt: The input datetime Returns: - is_dst: returns `true` if dt is in daylight savings time, `false` if not - success: returns `false` if the passed datetime is invalid

dst_unsafe #

Source
dst_unsafe :: proc(dt: DateTime) -> bool {…}

Checks DST for a given date. WARNING: This is unsafe because it doesn't check if your datetime is valid or if your region contains a valid record. Inputs: - dt: The input datetime Returns: - is_dst: returns `true` if dt is in daylight savings time, `false` if not

shortname #

Source
shortname :: proc(dt: DateTime) -> (name: string, success: bool) #optional_ok {…}

Gets the timezone abbreviation/shortname for a given date. (ex: "PDT") Inputs: - dt: The datetime containing the date, time, and timezone pointer for the lookup NOTE: The lifetime of name matches the timezone it was pulled from. Returns: - name: The timezone abbreviation - success: returns `false` if the passed datetime is invalid

shortname_unsafe #

Source
shortname_unsafe :: proc(dt: DateTime) -> string {…}

Gets the timezone abbreviation/shortname for a given date. (ex: "PDT") WARNING: This is unsafe because it doesn't check if your datetime is valid or if your region contains a valid record. Inputs: - dt: The input datetime NOTE: The lifetime of name matches the timezone it was pulled from. Returns: - name: The timezone abbreviation