Add date and time handling with ISO 8601 support.
Motivation
Timestamp comparison, duration calculation, and date formatting are needed for any data processing, logging, scheduling, or API interaction. ISO 8601 is the universal interchange format.
Proposed functions
now(-> @Int) effects(<IO>) — current Unix timestamp in milliseconds
datetime_parse(@String -> Result<@DateTime, @String>) — parse ISO 8601 string
datetime_format(@DateTime -> @String) — format as ISO 8601
datetime_add(@DateTime, @Int -> @DateTime) — add milliseconds
datetime_diff(@DateTime, @DateTime -> @Int) — difference in milliseconds
Implementation notes
DateTime is a host-provided type backed by milliseconds since Unix epoch. Timezone handling via IANA timezone database at the host level.
Dependencies
Add date and time handling with ISO 8601 support.
Motivation
Timestamp comparison, duration calculation, and date formatting are needed for any data processing, logging, scheduling, or API interaction. ISO 8601 is the universal interchange format.
Proposed functions
now(-> @Int) effects(<IO>)— current Unix timestamp in millisecondsdatetime_parse(@String -> Result<@DateTime, @String>)— parse ISO 8601 stringdatetime_format(@DateTime -> @String)— format as ISO 8601datetime_add(@DateTime, @Int -> @DateTime)— add millisecondsdatetime_diff(@DateTime, @DateTime -> @Int)— difference in millisecondsImplementation notes
DateTime is a host-provided type backed by milliseconds since Unix epoch. Timezone handling via IANA timezone database at the host level.
Dependencies