method Date.of
Validated constructor: Date.of(2026, 11, 3).
Example:
use std.time { Date }
fn main() io {
print("{Date.of(2026, 11, 3)!.toIso()} {Date.of(2026, 2, 31) is InvalidValue}")
}Output
2026-11-03 true
pub(api) static fn of(year: i64, month: i64, day: i64) -> Date | InvalidValueSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
year | i64 |
month | i64 |
day | i64 |
Returns
Errors
InvalidValue@error
Effects
none declared (pure unless the body says otherwise)
Defined in: std/time/time.oxl:1282