mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Initial cut of timezones
This commit is contained in:
@@ -77,12 +77,55 @@ Time :: struct {
|
||||
nano: i32,
|
||||
}
|
||||
|
||||
TZ_Record :: struct {
|
||||
time: i64,
|
||||
utc_offset: i64,
|
||||
shortname: string,
|
||||
dst: bool,
|
||||
}
|
||||
|
||||
TZ_Date_Kind :: enum {
|
||||
NoLeap,
|
||||
Leap,
|
||||
MonthWeekDay,
|
||||
}
|
||||
|
||||
TZ_Transition_Date :: struct {
|
||||
type: TZ_Date_Kind,
|
||||
|
||||
month: u8,
|
||||
week: u8,
|
||||
day: u16,
|
||||
|
||||
time: i64,
|
||||
}
|
||||
|
||||
TZ_RRule :: struct {
|
||||
has_dst: bool,
|
||||
|
||||
std_name: string,
|
||||
std_offset: i64,
|
||||
std_date: TZ_Transition_Date,
|
||||
|
||||
dst_name: string,
|
||||
dst_offset: i64,
|
||||
dst_date: TZ_Transition_Date,
|
||||
}
|
||||
|
||||
TZ_Region :: struct {
|
||||
name: string,
|
||||
records: []TZ_Record,
|
||||
shortnames: []string,
|
||||
rrule: TZ_RRule,
|
||||
}
|
||||
|
||||
/*
|
||||
A type representing datetime.
|
||||
*/
|
||||
DateTime :: struct {
|
||||
using date: Date,
|
||||
using time: Time,
|
||||
tz: ^TZ_Region,
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -130,4 +173,4 @@ Weekday :: enum i8 {
|
||||
}
|
||||
|
||||
@(private)
|
||||
MONTH_DAYS :: [?]i8{-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
|
||||
MONTH_DAYS :: [?]i8{-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
|
||||
|
||||
Reference in New Issue
Block a user