method Tm.parse
Parses ISO 8601 with an offset (2026-11-03T18:00:00+03:00) or a pattern; text without an offset is UTC.
Example:
use std.time { Time }
fn main() io {
print("{Time.parse("1970-01-01T00:01:00Z")!.unixSeconds()}")
}Output
60
pub(api) static fn parse(text: str, format: TimeFormat | str = .Iso8601) -> Tm | ParseErrorSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
text | str |
format | TimeFormat | str = .Iso8601 |
Returns
Tm
Errors
ParseError@error
Effects
none declared (pure unless the body says otherwise)
Defined in: std/time/time.oxl:1987