Replace chrono with jiff in the Rust SDK
RUSTSEC-2026-0543 marks chrono unmaintained, and #307 put it on cargo-deny's ignore list until replacing it could be its own release. This is that change: the Rust SDK moves to jiff 1.x, and the ignore comes out. basecamp/basecamp-sdk#1106 makes the same change there.
Why jiff, and why now
- chrono's maintainer soft-deprecated it in January (chronotope/chrono#1768), declined a handover, and held the advisory "until after the jiff 1.0 release". jiff 1.0 shipped 2026-11-15 with "an indefinite commitment to 1.x.y. Consumers of this library should feel confident about putting Jiff types into their public API." The floor is 1.0.1 (which fixes an out-of-bounds timestamp parse). Its MSRV is 1.85, under our 1.88, so
rust-versiondoesn't move. timewas the other candidate. It is still 0.x and has no tz database, whichDate::todayandfrom_datetime_inneed. ItsOffsetDateTimeserde isn't RFC 3339, so every generated field would need awithattribute.- The crate has no reverse dependencies on crates.io.
What changes
| Was | Now |
|---|---|
DateTime = chrono::DateTime<Utc> | jiff::Timestamp |
Date(pub chrono::NaiveDate) | Date(pub jiff::civil::Date) |
<Date as FromStr>::Err = chrono::ParseError | jiff::Error |
Date::from_datetime_in<Tz: chrono::TimeZone> | from_datetime_in(&DateTime, &jiff::tz::TimeZone) |
Date::at_midnight_utc() -> DateTime | -> Option<DateTime> (None only for 9999-12-31) |
chrono::Weekday in Date::weekday and Identity::set_first_week_day | jiff::civil::Weekday |
Token::expires_at: Option<DateTime<Utc>> | Option<jiff::Timestamp> |
| (none) | pub use jiff; |
The generator only names crate::types::{Date, DateTime}, so no generated code changes. MIGRATING.md has the upgrade notes.
What stays the same, and how it was checked
- Instants. I compared chrono's
DateTime<Utc>serde with jiff'sTimestampserde. They agree onZ, numeric offsets, a space separator, lowercaset/zand nine fractional digits. Both refuse a missing offset and a bare date. Output is byte-identical. They differ only at the edges: a leap second reads as:59, and more than nine fractional digits is refused. - Dates. jiff's own date parser accepts
20260304and2026-03-04T00:00:00.Datetherefore parses withstrptime("%Y-%m-%d"), which matches chrono's%Y-%m-%d, unpadded2026-3-4included.tests/dates.rsnow refuses both of those wider forms.Date::default()stays 1970-01-01 (jiff's own default is year zero).add_months/add_yearskeep Go'sAddDaterollover, which jiff's clamping arithmetic would not. Date::today(). jiff reads the zone withtz-system. Without a tz database it would silently fall back to UTC for aTZ=America/Chicagosetting and on Windows and Android, so the crate enablestzdb-zoneinfo,tzdb-bundle-platformandtzdb-concatenated. Checked againstchrono::Localwith TZ unset,Pacific/Kiritimati,Etc/GMT+12and an unknown zone: the same date in all four.- Retry-After.
jiff::fmt::rfc2822::parseagreed withchrono::DateTime::parse_from_rfc2822on 14 of 14 forms. Those covered GMT, UT, EST, PDT,Zand military zones, a missing weekday, two-digit years, missing seconds, a wrong weekday (refused by both), extra spaces, lowercase and a(UTC)comment. - Stored OAuth tokens.
expires_atis RFC 3339 UTC either way. make rs-check rs-check-drift rs-consumer-checkpasses locally: lint, tests, docs,cargo deny(advisories okwith an empty ignore list) for both workspaces, generated code up to date, and the consumer build with and without default features.
cargo semver-checks will flag the break; the breaking label is on.
Summary by cubic
Replaces the deprecated chrono crate with jiff 1.x in the Rust SDK, and drops the cargo-deny ignore for RUSTSEC-2026-0543. The wire format is unchanged — instants stay RFC 3339 and dates stay YYYY-MM-DD — so stored OAuth tokens read back as before, and no generated code changes. This is a breaking release; MIGRATING.md has the before-and-after table.
Migration
DateTimeisjiff::Timestamp,Datewrapsjiff::civil::Date, and the crate re-exportshey_sdk::jiff.Date::from_datetime_intakes ajiff::tz::TimeZone, andDate::at_midnight_utcreturnsOption<DateTime>,Noneat the calendar's ends.- Weekdays are spelled out:
Weekday::Mondayinstead ofWeekday::Mon. Datestill parses only%Y-%m-%d,Date::default()stays 1970-01-01, andadd_months/add_yearskeep Go'sAddDaterollover.Datenow prints through the same%Y-%m-%dit reads, so dates before year 0 still round-trip.