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()}")
}Вывод
60
pub(api) static fn parse(text: str, format: TimeFormat | str = .Iso8601) -> Tm | ParseErrorС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
text | str |
format | TimeFormat | str = .Iso8601 |
Возвращает
Tm
Ошибки
ParseError@error
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/time/time.oxl:1987