New pre-SRFI: Modern date and time library Daphne Preston-Kendal (09 Nov 2024 09:48 UTC)
Re: New pre-SRFI: Modern date and time library Alex Shinn (09 Nov 2024 11:49 UTC)
Re: New pre-SRFI: Modern date and time library Daphne Preston-Kendal (10 Nov 2024 19:52 UTC)
Re: New pre-SRFI: Modern date and time library John Cowan (11 Nov 2024 03:49 UTC)
Re: New pre-SRFI: Modern date and time library Alex Shinn (11 Nov 2024 04:33 UTC)
Re: New pre-SRFI: Modern date and time library Arthur A. Gleckler (09 Nov 2024 17:36 UTC)
Re: New pre-SRFI: Modern date and time library Pierpaolo Bernardi (10 Nov 2024 00:56 UTC)
Re: New pre-SRFI: Modern date and time library Arthur A. Gleckler (10 Nov 2024 04:28 UTC)
Re: New pre-SRFI: Modern date and time library Pierpaolo Bernardi (10 Nov 2024 05:06 UTC)
Re: New pre-SRFI: Modern date and time library Daphne Preston-Kendal (10 Nov 2024 10:11 UTC)
Re: New pre-SRFI: Modern date and time library Pierpaolo Bernardi (10 Nov 2024 15:02 UTC)
Re: New pre-SRFI: Modern date and time library Daphne Preston-Kendal (10 Nov 2024 15:37 UTC)
Re: New pre-SRFI: Modern date and time library Lassi Kortela (10 Nov 2024 15:57 UTC)
Re: New pre-SRFI: Modern date and time library Alex Shinn (11 Nov 2024 04:43 UTC)
Re: New pre-SRFI: Modern date and time library Daphne Preston-Kendal (10 Nov 2024 10:19 UTC)
Re: New pre-SRFI: Modern date and time library Daphne Preston-Kendal (03 Jan 2025 12:43 UTC)
Re: New pre-SRFI: Modern date and time library Marc Nieper-Wißkirchen (03 Jan 2025 14:08 UTC)
Re: New pre-SRFI: Modern date and time library Daphne Preston-Kendal (03 Jan 2025 14:56 UTC)
Re: New pre-SRFI: Modern date and time library Daphne Preston-Kendal (03 Jan 2025 15:03 UTC)
Re: New pre-SRFI: Modern date and time library Marc Nieper-Wißkirchen (03 Jan 2025 15:26 UTC)
Re: New pre-SRFI: Modern date and time library Marc Nieper-Wißkirchen (03 Jan 2025 15:22 UTC)
Re: New pre-SRFI: Modern date and time library Daphne Preston-Kendal (03 Jan 2025 20:45 UTC)
Re: New pre-SRFI: Modern date and time library Alex Shinn (05 Jan 2025 23:10 UTC)
Re: New pre-SRFI: Modern date and time library John Cowan (06 Jan 2025 01:12 UTC)
Re: New pre-SRFI: Modern date and time library Daphne Preston-Kendal (08 Sep 2025 19:58 UTC)

Re: New pre-SRFI: Modern date and time library Daphne Preston-Kendal 08 Sep 2025 19:57 UTC

On 6 Jan 2025, at 00:10, Alex Shinn <xxxxxx@gmail.com> wrote:

> Note the small language already defines `(current-second)` as TAI
> using the Unix epoch of 1 January 1970, not 1958.  This agrees with
> at least the glibc CLOCK_TAI:
>
> https://www.man7.org/linux/man-pages/man3/clock_gettime.3.html
>
> I think redefining the epoch in the large language would just cause
> confusion.

1970 is a really crummy epoch for TAI-based applications, because the difference between TAI and UTC was non-integral at the start of the year.

The original version of the small language spec got this wrong by claiming the difference at this point was ten seconds, when in fact it was 8.000082 seconds. This had to be corrected by erratum. <https://github.com/johnwcowan/r7rs-work/blob/master/R7RSSmallErrata.md#:~:text=27.,-The%20claim%20in>

There are two possible epochs that make sense i.m.o.: 1958, when TAI and UTC started diverging; and 1972, since when the difference between them has always been an integer except during leap seconds. The pre-SRFI at the moment uses the former.

Note that the proposed API of this pre-SRFI does not actually expose when the TAI-based epoch defined by the spec is: it’s merely used there as an aid to defining how moments and timestamps interact, but both of those are actually accessed by Gregorian date and not by any count of seconds. The small language’s current-second isn’t part of this proposal anyway; it’s a lower-level primitive.

So the better question might be whether it might actually be worth simplifying the spec by pretending that |TAI − UTC| was always 10 before 1 January 1972, instead of pretending it was always 0 before 1 January 1958, partially undoing the change made to the small language specification by erratum.

Daphne