Import with #import "std/calendar".

LeapYear :: (year: s32) -> bool
DaysInMonth :: (year: s32, month: s32) -> s32
DayOfWeek :: (year: s32, month: s32, day: s32) -> s32

Sunday is zero. Gregorian arithmetic avoids mktime's timezone changes when asking for the weekday of a calendar date.

DayOfYear :: (year: s32, month: s32, day: s32) -> s32
DateTimeValid :: (value: LocalDateTime) -> bool
FormatDateTime :: (value: LocalDateTime, pattern: string, output: []u8) -> string

Locale-independent English names and common strftime-style civil tokens. Unsupported tokens, invalid readings, or insufficient space return an empty view and clear output[0]. A successful result is NUL-terminated.

Source ↗ · All modules