mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-21 05:45:19 +00:00
add time.weekday proc
This commit is contained in:
@@ -170,6 +170,12 @@ day :: proc "contextless" (t: Time) -> (day: int) {
|
||||
return
|
||||
}
|
||||
|
||||
weekday :: proc "contextless" (t: Time) -> (weekday: Weekday) {
|
||||
abs := _time_abs(t)
|
||||
sec := (abs + u64(Weekday.Monday) * SECONDS_PER_DAY) % SECONDS_PER_WEEK
|
||||
return Weekday(int(sec) / SECONDS_PER_DAY)
|
||||
}
|
||||
|
||||
clock :: proc { clock_from_time, clock_from_duration, clock_from_stopwatch }
|
||||
|
||||
clock_from_time :: proc "contextless" (t: Time) -> (hour, min, sec: int) {
|
||||
|
||||
Reference in New Issue
Block a user