OxL Справочник OxL
РусскийEnglish

method Ldt.parse

Parses a local date-time in ISO 8601 form or with a pattern.

Example:

oxl✓ проверяется в CI
use std.time { LocalDateTime }

fn main() io {
  print("{LocalDateTime.parse("2026-11-03T18:30")!.toIso()}")
}
Вывод
2026-11-03T18:30:00
pub(api) static fn parse(text: str, format: TimeFormat | str = .Iso8601) -> Ldt | ParseError

С версии. 1.0.0-beta

Параметры

ИмяТип
textstr
formatTimeFormat | str = .Iso8601

Возвращает

Ldt

Ошибки

  • ParseError @error
  • `ParseError` when the text does not match the format.

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/time/time.oxl:1782

См. также