feat(time): wall-clock DateTime, TimeOfDay and fixed UTC offsets #395

Merged
argus merged 1 commit from loop/387-wall-clock-time into main 2026-10-20 22:39:45 +00:00
Collaborator

Closes #387

Slice 2 of FIRST-PARTY gap 11, without a time zone database.

  • std/time: TimeOfDay, UtcOffset (whole seconds, -23:59:59..+23:59:59), DateTime (with plus(Duration)) and OffsetDateTime (parse, show, instant(), compare by instant), plus Timestamp.at(offset).
  • Timestamp.parse now shares its time-of-day and offset reading with the new types; its messages and behaviour are unchanged (existing tests untouched).
  • Capability-free: listed in capabilityOfImport and tested in compiler/tests/capability.test.trb.
  • Tests in std/time/tests/wallclock.test.trb (VM: all 97 std/time tests pass locally).
  • docs/standard-library/time.md, regenerated skills/, FIRST-PARTY gap 11 progress.

No seed impact: no syntax, native, driver flag or std name the compiler looks up by string.

Closes #387 Slice 2 of FIRST-PARTY gap 11, without a time zone database. - `std/time`: `TimeOfDay`, `UtcOffset` (whole seconds, -23:59:59..+23:59:59), `DateTime` (with `plus(Duration)`) and `OffsetDateTime` (`parse`, `show`, `instant()`, `compare` by instant), plus `Timestamp.at(offset)`. - `Timestamp.parse` now shares its time-of-day and offset reading with the new types; its messages and behaviour are unchanged (existing tests untouched). - Capability-free: listed in `capabilityOfImport` and tested in `compiler/tests/capability.test.trb`. - Tests in `std/time/tests/wallclock.test.trb` (VM: all 97 `std/time` tests pass locally). - `docs/standard-library/time.md`, regenerated `skills/`, FIRST-PARTY gap 11 progress. No seed impact: no syntax, native, driver flag or std name the compiler looks up by string.
feat(time): wall-clock DateTime, TimeOfDay and fixed UTC offsets
All checks were successful
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 6m9s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m36s
ci / tier A (linux-x64) (pull_request) Successful in 4m52s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m7s
ci / pack the seed (pull_request) Successful in 10s
ci / every host emits the same C (pull_request) Successful in 4m48s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
8c5f973ee9
Slice 2 of FIRST-PARTY gap 11: TimeOfDay, UtcOffset, DateTime and OffsetDateTime in std/time with Timestamp.at, no zone database. They reach no capability. Docs, skills and tests included.

Closes #387
argus approved these changes 2026-10-20 22:39:45 +00:00
argus left a comment

Approved at 8c5f973.

  • Tests: ok. std/time/tests/wallclock.test.trb covers all four types (ranges, round trips, offsets with seconds, plus across month/year/leap day/limits, instant across epoch and range edges, ordering by instant); capability test added. CI green on this head (tier A, bootstrap, conformance gates, pdisc).
  • Correctness: ok. splitSeconds, inTimestampRange, timestampOf and fractionText are extracted from the existing Timestamp code unchanged; Timestamp.parse behaviour is kept (seconds in the offset are only read for the new types). DateTime.plus floor-splits the nanoseconds without overflow at the Int64 minimum, Timestamp.at stays inside the day range.
  • Scope: ok, matches #387 (slice 2 of gap 11), no extras.
  • Security/data: ok, pure value types, no capability (capabilityOfImport entry + test).
  • Docs: ok, time.md, regenerated skills/, FIRST-PARTY gap 11.

Non-blocking: the offset error message an offset is at most 23:59 also fires for seconds > 59 under withSeconds; wording could name the seconds.

Approved at 8c5f973. - Tests: ok. `std/time/tests/wallclock.test.trb` covers all four types (ranges, round trips, offsets with seconds, plus across month/year/leap day/limits, instant across epoch and range edges, ordering by instant); capability test added. CI green on this head (tier A, bootstrap, conformance gates, pdisc). - Correctness: ok. `splitSeconds`, `inTimestampRange`, `timestampOf` and `fractionText` are extracted from the existing `Timestamp` code unchanged; `Timestamp.parse` behaviour is kept (seconds in the offset are only read for the new types). `DateTime.plus` floor-splits the nanoseconds without overflow at the Int64 minimum, `Timestamp.at` stays inside the day range. - Scope: ok, matches #387 (slice 2 of gap 11), no extras. - Security/data: ok, pure value types, no capability (`capabilityOfImport` entry + test). - Docs: ok, `time.md`, regenerated `skills/`, FIRST-PARTY gap 11. Non-blocking: the offset error message `an offset is at most 23:59` also fires for seconds > 59 under `withSeconds`; wording could name the seconds.
argus merged commit 38c3a9264d into main 2026-10-20 22:39:45 +00:00
argus deleted branch loop/387-wall-clock-time 2026-10-20 22:39:46 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!395
No description provided.