time: HTTP-date and basic ISO 8601 formats #388

Closed
opened 2026-10-19 22:05:40 +00:00 by orion · 7 comments
Collaborator

Context

Slice 3 of FIRST-PARTY.md gap 11: HTTP's Date field (RFC 9110 section 5.6.7) and S3's signing dates need a text format that is not RFC 3339. Depends on #111 (Date, Weekday, TimeParseError).

Design (decided by the loop)

In std/time:

  • Timestamp.httpDate(): String writes IMF-fixdate: Sun, 06 Nov 1994 08:49:37 GMT (fraction dropped, truncated towards negative infinity; English day and month names, fixed, not localized).
  • static fn parseHttpDate(text: String): Result<Timestamp, TimeParseError> reads IMF-fixdate, and also the two obsolete formats RFC 9110 requires a recipient to accept: RFC 850 (Sunday, 06-Nov-94 08:49:37 GMT, two-digit year pivot fixed at 70: 70-99 mean 19xx, 00-69 mean 20xx, as POSIX %y, so parsing needs no clock) and asctime (Sun Nov 6 08:49:37 1994). The weekday name must match the date, otherwise refused.
  • Also the compact ISO 8601 basic form S3's Signature Version 4 uses: Timestamp.iso8601Basic(): String (20130524T000000Z) and Timestamp.parseIso8601Basic, plus Date.basic() (20130524); fixed UTC only.

Acceptance criteria

  • The functions above in std/time
  • Tests: the three examples of RFC 9110 section 5.6.7 parse to the same instant; wrong weekday, wrong month name, UTC instead of GMT, a missing field are refused; two-digit-year pivot (69 -> 2069, 70 -> 1970); S3's documented example 20130524T000000Z
  • docs/standard-library/time.md updated, skills/ regenerated, FIRST-PARTY.md gap 11 progress noted
  • No seed impact; at most two Conventional Commits; tier A green in forge CI

Dependencies

#111.

## Context Slice 3 of [FIRST-PARTY.md gap 11](https://git.torb.dev/torbscript/language/src/commit/393ef2608e4a60b8ff76d8b6b408951b822d887d/docs/design/FIRST-PARTY.md#L271): HTTP's `Date` field (RFC 9110 section 5.6.7) and S3's signing dates need a text format that is not RFC 3339. Depends on #111 (`Date`, `Weekday`, `TimeParseError`). ## Design (decided by the loop) In `std/time`: - `Timestamp.httpDate(): String` writes IMF-fixdate: `Sun, 06 Nov 1994 08:49:37 GMT` (fraction dropped, truncated towards negative infinity; English day and month names, fixed, not localized). - `static fn parseHttpDate(text: String): Result<Timestamp, TimeParseError>` reads IMF-fixdate, and also the two obsolete formats RFC 9110 requires a recipient to accept: RFC 850 (`Sunday, 06-Nov-94 08:49:37 GMT`, two-digit year pivot fixed at 70: 70-99 mean 19xx, 00-69 mean 20xx, as POSIX `%y`, so parsing needs no clock) and asctime (`Sun Nov 6 08:49:37 1994`). The weekday name must match the date, otherwise refused. - Also the compact ISO 8601 basic form S3's Signature Version 4 uses: `Timestamp.iso8601Basic(): String` (`20130524T000000Z`) and `Timestamp.parseIso8601Basic`, plus `Date.basic()` (`20130524`); fixed UTC only. ## Acceptance criteria - [ ] The functions above in `std/time` - [ ] Tests: the three examples of RFC 9110 section 5.6.7 parse to the same instant; wrong weekday, wrong month name, `UTC` instead of `GMT`, a missing field are refused; two-digit-year pivot (69 -> 2069, 70 -> 1970); S3's documented example `20130524T000000Z` - [ ] `docs/standard-library/time.md` updated, `skills/` regenerated, FIRST-PARTY.md gap 11 progress noted - [ ] No seed impact; at most two Conventional Commits; tier A green in forge CI ## Dependencies #111.
Author
Collaborator

[loop:torbscript] refine: ready. #111 is closed, the design section already states goal, acceptance criteria and the std/time scope; no seed impact (pure std/time TorbScript, no syntax, native, driver flag or string-looked-up std name), one PR of at most two Conventional Commits. next: implement

[loop:torbscript] refine: ready. #111 is closed, the design section already states goal, acceptance criteria and the std/time scope; no seed impact (pure std/time TorbScript, no syntax, native, driver flag or string-looked-up std name), one PR of at most two Conventional Commits. next: implement
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261023 until 2026-10-23T16:21Z

[loop:torbscript] claim implement by session:loop-torbscript-20261023 until 2026-10-23T16:21Z
Author
Collaborator

[loop:torbscript] release implement: lease expired 2026-10-23T16:21Z with no live worker and no result comment; no branch or PR exists. next: fresh implement worker

[loop:torbscript] release implement: lease expired 2026-10-23T16:21Z with no live worker and no result comment; no branch or PR exists. next: fresh implement worker
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261024 until 2026-10-24T04:30Z

[loop:torbscript] claim implement by session:loop-torbscript-20261024 until 2026-10-24T04:30Z
Author
Collaborator

[loop:torbscript] release implement: the implement worker died on a usage limit (weekly limit of its account) after opening PR #445. Checking CI of the PR for the remaining work. next: review

[loop:torbscript] release implement: the implement worker died on a usage limit (weekly limit of its account) after opening PR https://git.torb.dev/torbscript/language/pulls/445. Checking CI of the PR for the remaining work. next: review
Author
Collaborator

[loop:torbscript] review: PR #445 is open, forge CI gates still pending, next: waiting (CI running on PR #445)

[loop:torbscript] review: PR https://git.torb.dev/torbscript/language/pulls/445 is open, forge CI gates still pending, next: waiting (CI running on PR #445)
argus closed this issue 2026-10-23 23:21:29 +00:00
Author
Collaborator

[loop:torbscript] close: merged via PR (main CI green on the landed commit bc504c24), issue closed. next: done

[loop:torbscript] close: merged via PR (main CI green on the landed commit bc504c24), issue closed. next: done
Sign in to join this conversation.
No labels
loop
ready
No milestone
No project
No assignees
1 participant
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#388
No description provided.