OxL Reference

method Ldt.parse

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

Example:

oxl✓ checked in CI
use std.time { LocalDateTime }

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

Since. 1.0.0-beta

Parameters

NameType
textstr
formatTimeFormat | str = .Iso8601

Returns

Ldt

Errors

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

Effects

none declared (pure unless the body says otherwise)

Defined in: std/time/time.oxl:1782

See also