Skip to content

Date and time handling #233

@aallan

Description

@aallan

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

  • None

Metadata

Metadata

Assignees

No one assigned

    Labels

    C9C9 — Language designenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions