Jiff 1.0 is a Rust datetime library release aimed at making date and time operations safer by modeling their real-world complexity instead of leaving it to each programmer. The release formalizes a long-term stability commitment: because Jiff is already used in production and may appear in other libraries’ public APIs, incompatible changes will be made only for significant defects. The library’s central concern is the gap between machine time and human civil time, especially the way time-zone rules can make a local clock reading ambiguous or invalid.
Jiff organizes its types in layers: a civil date and time describe a calendar reading without a location; a timestamp identifies one instant; a time zone maps between instants and local readings; and a zoned datetime combines all three. Its examples show conversions in both directions and explain how daylight-saving transitions create repeated or skipped times. By default, Jiff resolves ambiguity compatibly, while its API also lets callers choose the earlier or later interpretation or require an unambiguous result. The release tour also covers duration representations, parsing and formatting, date arithmetic and rounding, other calendars, span manipulation, and ICU4X-based locale-sensitive formatting. Together, these features make time-zone handling central to the API and aim to reduce common datetime mistakes.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.