Re: New pre-SRFI: Modern date and time library
Pierpaolo Bernardi 10 Nov 2024 05:06 UTC
On Sun, Nov 10, 2024 at 5:29 AM Arthur A. Gleckler <xxxxxx@speechcode.com> wrote:
>
> On Sat, Nov 9, 2024 at 4:56 PM Pierpaolo Bernardi <xxxxxx@gmail.com> wrote:
>
>>
>> ISO-8601 calls this a "local time", and, of course, defines a syntax
>> for it. An example of local time in ISO-8601 syntax is: "21:00"
>
> Yes, of course. But that's a string representation of a local time. What does one use internally to represent such a time? A special time zone that means "where I am?"
If I was implementing this, I would use three disjoint record types,
with a common parent, for local times, UTC times, and "time-zoned"
times. Plus the necessary functions to convert between them.
In your example, to schedule the 9pm local time event among other
events, one would apply to all the events specified in local time a
function which takes a local time and the desired time zone (maybe the
current-default-timezone...) and returns a "time-zoned" time.