mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 06:38:47 +00:00
Initial cut of timezones
This commit is contained in:
@@ -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}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user