RFC 5545 section 3.3.5 extracted DATE-TIME values, profile datetime-values-v1.
Accept YYYYMMDDTHHMMSS with optional Z, years 0001–9999, whole seconds.
ASCII t/z are accepted and canonical output uses uppercase. Numeric offsets,
fractions, lists, whitespace and content lines are malformed. Leap seconds
are explicitly unsupported on this POSIX profile, never normalized to 59.
Local means the value has no Z. A surrounding property may supply TZID;
this value parser does not invent, retain or validate a property parameter.
Without TZID the RFC property is floating. source/local_label expose the
validated fields for the shared recurrence and zone APIs with explicit context.
Equality includes the UTC/local form; no cross-form total order is defined.
These are timestamp labels, not second-wide calendar selections.
Parsing and formatting have constant work and bounded output. A syntactically
valid truncated prefix returns Incomplete; malformed prefixes return Malformed.
Source spelling and full ICS documents are outside this value profile.
parser_for : encoding -> (state -> Try({ value : ICalDateTime, rest : state }, [InvalidICalDateTime(Error), Encoding(err), ..]))
where [
encoding.parse_str : encoding, state -> Try({ value : Str, rest : state }, err),
]
Decode one encoded string using this type's text parser.
Encoding failures remain distinct from this profile's validation errors.
The encoding owns framing and its work limits; parse bounds the decoded text.
encoder_for : encoding -> (ICalDateTime, state -> Try(state, err))
where [
encoding.encode_str : Str, state -> Try(state, err),
]
Encodes the canonical standard text as a string in the selected encoding; encoding failures pass through.