@burntsushi To state for the community since I've seen some concern that other library maintainers may be opposed: that is not the case. He reached out to numerous maintainers over a week ago wherein we all had a detailed discussion about various choices. No one was opposed to "yet another" datetime library, myself included.
Conversely, in Jiff, all time zone lookups by name are cached.
Is the cache invalidated if system tzdata is updated?
And what effect does the answer have on the example from "Jiff supports detecting time zone offset conflicts" if both zoned datetimes used the system timezone which got updated between 1. opening 2. parsing the two zoned datetimes.
Jiff losslessly roundtrips time zone aware datetimes
In this section, wouldn't be more realistic for chrono users to use timezone info around the wire instead of on the wire, rather than using Local+FixedOffset?
Is the cache invalidated if system tzdata is updated?
Yes, although at present, there is a TTL. So an update may take "time" to propagate. jiff::tz::db().reset() will force the cache to be invalidated. I expect the cache invalidation logic to get tweaked as we get real experience with it.
And what effect does the answer have on the example from “Jiff supports detecting time zone offset conflicts” if both zoned datetimes used the system timezone which got updated between 1. opening 2. parsing the two zoned datetimes.
New updates to tzdb are only observed when you do a tzdb lookup.
In this section, wouldn’t be more realistic for chrono users to use timezone info around the wire instead of on the wire, rather than using Local+FixedOffset?
That's kinda my point. How do they do that? And does it work with chrono-tzandtzfile? And what happens if tzdb updates lead to a serialized datetime with an incorrect offset in a future update of tzdb? There are all sorts of points of failure here that Jiff will handle for you by virtue of tighter integration with tzdb as a first class concept.
In this section, wouldn't be more realistic for chrono users to use timezone info around the wire instead of on the wire, rather than using Local+FixedOffset?
They do say that the difference is that chrono users would need to keep out-of-band timezone information in addition to the datetime, whereas Jiff does it in-band.
That's fine. I didn't look at the code, but from what I gather, Jiff serializes the timezone name (not detailed tz info). chrono users would communicate the same thing, but it's not built-in functionality in the dt type itself.
The example I referred to however may imply that chrono users would be inclined do the wrong thing, and get the wrong result as a sequence.
(humble personal opinion bit) It feels like it's a case where the example was pushed a bit extra to fit into the "jump into the pit of success/despair" reference. A reference many, young and old, wouldn't recognize, or otherwise wouldn't care for anyway.
I really likes this package. And I may use it immediately. Very complete and detailed documentation. It lacks in some conveniences like iso8601, rfc3339 or other presets for formatting. But those can be handled manually. Thanks for this!
You should absolutely not need to handle ISO 8601 and RFC 3339 manually. They are supported via the Display and FromStr trait implementations on every main type in Jiff (Span, Zoned, Timestamp, civil::DateTime, civil::Date and civil::Time). It's technically an implementation of a mixture of ISO 8601, RFC 3339 and RFC 9557, but the grammar is specified precisely by Temporal. See: https://docs.rs/jiff/latest/jiff/fmt/temporal/index.html
Speaking of convenient things best not handled manually, do you have any plans to get support for it into crates like sqlx-postgresql, diesel or humantime where conversions need to happen but pretty much the same way for every user of the library?