NaiveDateTime

Core

Wall-clock date and time without a time zone.

Use with Time.Zone via fromPosix / toPosix. Instants stay as Time.Posix.

Types

NaiveDateTime

type NaiveDateTime = NaiveDateTime Int

A local date and time with no zone.

Values

fromParts

fromParts : Parts -> Maybe NaiveDateTime

Build from calendar parts. Returns Nothing when the date or time of day is out of range (including impossible leap days).

toParts

toParts : NaiveDateTime -> Parts

Split into calendar parts.

fromPosix

fromPosix : Zone -> Posix -> NaiveDateTime

Local wall time of posix in zone.

toPosix

toPosix : Zone -> NaiveDateTime -> Result String Posix

Convert local wall time to a Posix instant in zone.

Returns Err when the local time is missing or ambiguous across a DST transition (best-effort check against the civil fields after conversion).

compare

compare : NaiveDateTime -> NaiveDateTime -> Order

Order naive date-times.