Repository navigation
Replace chrono with jiff for timestamps - #618
Open
HackingGate wants to merge 1 commit into
Open
HackingGate wants to merge 1 commit into
HackingGate wants to merge 1 commit into
Conversation
chrono is unmaintained (RUSTSEC-2026-0543), and its maintainer recommends jiff. Timestamps are now `jiff::ZonedDateTime` instead of `chrono::DateTime<FixedOffset>`. The serialized form is unchanged, and deserialized timestamps keep their UTC offset as a fixed-offset time zone. jiff 1.0 requires Rust 1.85, so the MSRV moves from 1.79 to 1.85.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
chrono is now flagged as unmaintained (RUSTSEC-2026-0543, from chronotope/chrono#1768). The advisory recommends jiff or time. This PR replaces chrono with jiff 1.0, which also answers the question in #429 about how timestamps would be stored without chrono.
Related: #429
Changes
timestampfields andset_timestampmethods onReport,TestSuite,TestCaseandTestRerunnow usejiff::ZonedDateTimeinstead ofchrono::DateTime<FixedOffset>.ZonedDateTimeis jiff's type for an instant together with an offset, so it keeps the UTC offset that the XML carries. A barejiff::Timestampwould lose it.DateTime.%Y-%m-%dT%H:%M:%S%.3f%:zformat, for example2021-04-01T10:52:37.000-08:00. A zero offset is still written as+00:00, neverZ, and fractional seconds are truncated to milliseconds. The golden fixtures are byte-for-byte unchanged.jiff::fmt::temporal::Piecesand keeps its offset as a fixed-offset time zone. A value without a time, without an offset, or with a[...]time zone annotation is rejected withParseTimestampError.rust-version, the MSRV CI job,lib.rsand the README badge and text. jiff 0.2 would keep 1.79, but this type is part of the public API, so 1.0 avoids a second breaking change later.default-features = false, features = ["std"], so it pulls in no tzdb or system time zone code. The normal dependency tree loseschronoandnum-traitsand gainsjiffandjiff-core.Behaviour differences when parsing
jiff's parser accepts some ISO 8601 forms that
DateTime::parse_from_rfc3339rejects:20230101T000000Z+0530or+05It also reads the leap second
23:59:60as23:59:59. Every input that chrono accepted is still accepted, and gives the same output. I compared the two parsers on these cases in a separate crate.Tests
+00:00offset, millisecond truncation, a+05:45offset, and keeping the offset across a round trip.cargo nextest run --all-featureson stable and on 1.85cargo clippy --all-targets -D warningswith no features, withproptest, withinternal-testingand with all featurescargo xfmt --checkcargo doc --all-featurescargo checkinfuzz/