Jiff – A datetime library for Rust – reaches 1.0 burntsushi.net · 8 points · 2 c...

@best

Jiff – A datetime library for Rust – reaches 1.0 burntsushi.net · 8 points · 2 comments · HN thread

TL;DR Andrew Gallant (BurntSushi) announces Jiff 1.0, a Rust datetime library that puts time zone handling at the center of its API and is modeled on JavaScript's Temporal. The post is a long tour of the API covering zoned datetimes, DST ambiguity, spans and durations, parsing and formatting, ICU4X locale integration, and rounding. He commits to keeping the 1.0 API stable indefinitely.

  • Jiff is already used in production by projects including uv, Cargo, Starship, fd, Nushell, mise, Jujutsu, uutils/coreutils, and as the basis for a Temporal implementation in AWS LLRT.
  • The author commits to the Jiff 1.0 API indefinitely unless a significant defect is found, since it is meant to appear in other libraries' public APIs and semver breaks would be costly.
  • Core types form an 'onion': civil::Date, civil::Time, civil::DateTime, Timestamp, TimeZone, and ZonedDateTime. DST gaps and folds are resolved by a 'compatible' default, with earlier, later, and reject strategies available.
  • Span keeps each unit distinct (2 hours is not equal in memory to 120 minutes) and is compared with Span::compare; SignedDuration covers physical time only.
  • Jiff adds a lossless 'friendly' duration format (e.g. '1y 1mo 1d 1h') because ISO 8601 durations cannot round-trip every Span, such as 2000 milliseconds becoming 2 seconds.
  • Jiff only supports the proleptic Gregorian calendar, has a datetime range of roughly ±9999 years, and leaves locale formatting to ICU4X through the jiff-icu crate.

Discussion The thread is very small, with only two comments. It centers on a critical question about Jiff's time zone model. A commenter says Jiff is too inflexible to represent all iCalendar VTIMEZONE entries, notes an open issue with no consensus, and argues that this limitation cannot be fixed without breaking the API. The author, burntsushi, asks for a concrete explanation of why the change would be breaking. The mood is polite and technical, with a sceptical note about whether a 1.0 release is ready for calendar-heavy use cases.

  • Jiff's time zone model is too rigid for iCalendar VTIMEZONE data (a few): WhyNotHugo has found Jiff's time zone handling disappointing because it cannot represent every VTIMEZONE entry. They say an issue was opened with no consensus, and they consider the gap unfixable without a breaking change, which makes the 1.0 release disappointing to them.
  • Asks for a concrete reason the fix would break the API (a few): The maintainer, burntsushi, asks for a specific explanation of why the limitation could not be addressed in a backward-compatible way. The question is open and no answer appears in the thread.

#Rust #datetime #timeZones #libraryRelease #Temporal