datetime_iso8601

Parse ISO8601 date-times! But you should probably use RFC3339 instead

Package Version Hex Docs

The ISO8601 date-time format is complex. Unless you have particular need for things like 2024-W11 you are better off using the RFC3339 format, which the gleam_time package supports.

gleam add datetime_iso8601@1
import datetime_iso8601

pub fn main() -> Nil {
  assert datetime_iso8601.parse("2024-W11")
    == Ok(datetime_iso8601.YearWeek(2024, 11))
}

Documentation can be found at https://hexdocs.pm/datetime_iso8601.

Search Document