package core:time/timezone
Index
Constants (3)
Variables (0)
This section is empty.
Procedure Groups (0)
This section is empty.
Types
Sun_Shift ¶
Sun_Shift :: enum u8 { Standard = 0, DST = 1, }
TZif_Version ¶
TZif_Version :: enum u8 { V1 = 0, V2 = 50, V3 = 51, V4 = 52, }
Constants
BIG_BANG_ISH ¶
BIG_BANG_ISH :: -0x800000000000000
Variables
This section is empty.
Procedures
datetime_to_str ¶
datetime_to_str :: proc(dt: datetime.DateTime, allocator := context.allocator) -> string {…}
datetime_to_tz ¶
datetime_to_tz :: proc(dt: datetime.DateTime, tz: ^datetime.TZ_Region) -> (out: datetime.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 ¶
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 ¶
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
load_tzif_file ¶
load_tzif_file :: proc(filename: string, region_name: string, allocator := context.allocator) -> (out: ^datetime.TZ_Region, ok: bool) {…}
parse_posix_rrule ¶
parse_posix_rrule :: proc(str: string) -> (out: datetime.TZ_Transition_Date, idx: int, ok: bool) {…}
parse_posix_tz ¶
parse_posix_tz :: proc(posix_tz: string, allocator := context.allocator) -> (out: datetime.TZ_RRule, ok: bool) {…}
parse_tzif ¶
parse_tzif :: proc(_buffer: []u8, region_name: string, allocator := context.allocator) -> (out: ^datetime.TZ_Region, ok: bool) {…}
region_destroy ¶
region_destroy :: proc(region: ^datetime.TZ_Region, allocator := context.allocator) {…}
region_load ¶
region_load :: proc(reg: string, allocator := context.allocator) -> (out_reg: ^datetime.TZ_Region, ok: bool) {…}
region_load_from_buffer ¶
region_load_from_buffer :: proc(buffer: []u8, reg: string, allocator := context.allocator) -> (out_reg: ^datetime.TZ_Region, ok: bool) {…}
region_load_from_file ¶
region_load_from_file :: proc(file_path, reg: string, allocator := context.allocator) -> (out_reg: ^datetime.TZ_Region, ok: bool) {…}
rrule_destroy ¶
rrule_destroy :: proc(rrule: datetime.TZ_RRule, allocator := context.allocator) {…}
shortname ¶
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 ¶
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
Procedure Groups
This section is empty.
Source Files
- tzdate.odin
- tzif.odin
- (hidden platform specific files)
Generation Information
Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-06 21:12:13.595962200 +0000 UTC