def parse_iso8601

cswap-bend-cli@0.1.0.0 · clock.bend:235

import cswap-bend-cli@0.1.0.0/clock.bend as Clock
import Base

235# Unix seconds of `2026-10-30T09:00:00+00:00`, `...Z`, `...00.123456Z`, a
236# `-HH:MM` offset, or a bare stamp (read as UTC); None when malformed.
237def parse_iso8601(+s: String) -> Maybe<&2, U32>:
238  do Maybe<&2, U32>:
239    y : U32 <- num(s, 0n, 4n)
240    mo : U32 <- num(s, 5n, 2n)
241    d : U32 <- num(s, 8n, 2n)
242    parse.time(s, y, mo, d)

Uses (6)

Used by (6)