method ZonedTime.parse
Parses ISO 8601 (2026-11-03T18:00:00+03:00[Europe/Moscow]) or a pattern with XXX / VV.
Example:
use std.time { ZonedTime }
fn main() io {
let z = ZonedTime.parse("2026-11-03T18:00:00+03:00[Europe/Moscow]")!
print("{z.time.unixSeconds()} {z.tz.name}")
}Output
1793718000 Europe/Moscow
pub(api) static fn parse(text: str, format: TimeFormat | str = .Iso8601) -> ZonedTime | ParseErrorSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
text | str |
format | TimeFormat | str = .Iso8601 |
Returns
Errors
ParseError@error- `ParseError` when the text does not match the format or names an unknown zone.
Effects
none declared (pure unless the body says otherwise)
Defined in: std/time/time.oxl:2391