Skip to content

Rfc2822

[Source]

RFC 2822 / 5322 (email date) parsing and formatting. See: https://datatracker.ietf.org/doc/html/rfc5322 (§3.3)

Example: Sun, 25 May 2026 12:00:00 -0700

Accepted on parse: - Optional day-of-week prefix (3-letter + comma + space); not validated against the computed day-of-week. - 1- or 2-digit day-of-month. - Case-insensitive 3-letter month name. - 4-digit year. - HH:MM or HH:MM:SS time. - Numeric offset +HHMM / -HHMM, or the legacy zone names UT/GMT/EST/EDT/CST/CDT/MST/MDT/PST/PDT. - Single space as field separator (FWS / CFWS folding rules from RFC 5322 §3.2.2 are not implemented in v1).

Emitted on format: the canonical form with day-of-week, 2-digit day, capital-case 3-letter month, 4-digit year, HH:MM:SS, numeric offset (+0000 for UTC, never GMT/UT).

primitive val Rfc2822

Constructors

create

[Source]

new val create()
: Rfc2822 val^

Returns


Public Functions

parse

[Source]

fun box parse(
  s: String val)
: (ZonedDateTime iso^ | ParseError)

Parameters

Returns


parse_in_place

[Source]

fun box parse_in_place(
  s: String val,
  zdt: ZonedDateTime ref)
: (None val | ParseError)

Parameters

Returns


format

[Source]

fun box format(
  zdt: ZonedDateTime box)
: String iso^

Parameters

Returns


format_in_place

[Source]

fun box format_in_place(
  zdt: ZonedDateTime box,
  buf: String ref)
: None val

Parameters

Returns


is_digit

[Source]

fun box is_digit(
  c: U8 val)
: Bool val

Parameters

  • c: U8 val

Returns


eq

[Source]

fun box eq(
  that: Rfc2822 val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: Rfc2822 val)
: Bool val

Parameters

Returns