Initial cut of timezones

This commit is contained in:
Colin Davidson
2024-12-01 11:54:50 +11:00
committed by flysand7
parent b7e61095a9
commit fc9983e9c8
9 changed files with 1627 additions and 6 deletions
+3 -3
View File
@@ -76,7 +76,7 @@ datetime, an error is returned.
components_to_datetime :: proc "contextless" (#any_int year, #any_int month, #any_int day, #any_int hour, #any_int minute, #any_int second: i64, #any_int nanos := i64(0)) -> (datetime: DateTime, err: Error) {
date := components_to_date(year, month, day) or_return
time := components_to_time(hour, minute, second, nanos) or_return
return {date, time}, .None
return {date, time, nil}, .None
}
/*
@@ -88,7 +88,7 @@ object will always have the time equal to `00:00:00.000`.
*/
ordinal_to_datetime :: proc "contextless" (ordinal: Ordinal) -> (datetime: DateTime, err: Error) {
d := ordinal_to_date(ordinal) or_return
return {Date(d), {}}, .None
return {Date(d), {}, nil}, .None
}
/*
@@ -433,4 +433,4 @@ unsafe_ordinal_to_date :: proc "contextless" (ordinal: Ordinal) -> (date: Date)
day := i8(ordinal - unsafe_date_to_ordinal(Date{year, month, 1}) + 1)
return {year, month, day}
}
}