Skip to content

Add REZonedDateAndTime: a local time in a time zone - #5

Merged
noha merged 1 commit into
mainfrom
a-local-time-in-a-zone
Nov 10, 2026
Merged

noha merged 1 commit into
mainfrom
a-local-time-in-a-zone

Conversation

@noha

@noha noha commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

A wall-clock time and the id of its zone, as RFC 9557 writes it: 2026-11-09T09:00:00+01:00[Europe/Berlin]. The offset is not stored but worked out when the moment is asked for, from the zone database that ZTimezone reads -- +01:00 in winter, +02:00 in summer -- so the value stays right when a zone's rules change. It does no arithmetic of its own: adding days to a DateAndTime keeps its offset and lands an hour off across the change to summer time.

Local times that are not one moment are read as RFC 5545 reads them: a time the clock jumps over takes the offset before the jump, a time that comes twice is the first of the two, unless an offset given with it picks the other. ZTimezone alone answers the later of the two for the second case, so the choice is made here.

This is the anchor a recurrence will carry, the way DTSTART carries TZID; the expressions themselves stay rules over calendar days. The central scheduler needs it to compute recurring schedules in the zone they were made in.

RecurringEvents-Core now requires ZTimestamp, with the same spec ApptiveScript uses, so an image that loads both asks for one.

RecurringEvents-Tests 149/149 in pharo-c, 11 of them new. Choosing the smaller of two offsets fails the test for a time that comes twice.

A wall-clock time and the id of its zone, as RFC 9557 writes it:
2026-11-09T09:00:00+01:00[Europe/Berlin]. The offset is not stored but
worked out when the moment is asked for, from the zone database that
ZTimezone reads -- +01:00 in winter, +02:00 in summer -- so the value stays
right when a zone's rules change. It does no arithmetic of its own: adding
days to a DateAndTime keeps its offset and lands an hour off across the
change to summer time.

Local times that are not one moment are read as RFC 5545 reads them: a time
the clock jumps over takes the offset before the jump, a time that comes
twice is the first of the two, unless an offset given with it picks the
other. ZTimezone alone answers the later of the two for the second case, so
the choice is made here.

This is the anchor a recurrence will carry, the way DTSTART carries TZID;
the expressions themselves stay rules over calendar days. The central
scheduler needs it to compute recurring schedules in the zone they were
made in.

RecurringEvents-Core now requires ZTimestamp, with the same spec
ApptiveScript uses, so an image that loads both asks for one.

RecurringEvents-Tests 149/149 in pharo-c, 11 of them new. Choosing the
smaller of two offsets fails the test for a time that comes twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noha
noha merged commit 861b256 into main Nov 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant