Re: New pre-SRFI: Modern date and time library
Antero Mejr 26 Dec 2024 20:11 UTC
> <https://gitlab.com/dpk/presrfis/-/blob/master/date-time.md>
Thanks for this, it looks really helpful. Is this intended to supersede
or supplement SRFI 19? If it supersedes SRFI 19, would the interface be
backwards-compatible to some extent?
Some thoughts:
Can the phrase:
"implementations should use the time zone database provided by the
operating system"
be extended with something like:
"..., and respect user-specified settings relating to such."
That way users can (hopefully) count on implementations respecting
things like $TZDIR, which is necessary on some systems.
Also it may be worth explicitly mentioning or requiring use of the IERS
leap seconds database, if the SRFI mentions or requires use of the Olson
DB.
For the timezones, would it make sense to provide a tai-timezone with no
delta, then replace utc-offset-timezone with a more general
`(timezone-offset-timezone TZ DT)` for composability? In case a user
wants to parse leap-seconds.list and a zoneinfo file manually, like
this:
```
;; Two leap seconds plus one hour.
(define two-leap-sec (seconds-dt -2)) ;parsed from leap-seconds.list
(define cet-plus1-zone (hours-dt 1)) ;parsed from zoneinfo
(define offset (dt+ two-leap-sec cet-plus1-zone))
(define my-timezone (timezone-offset-timezone
tai-timezone
offset))
```