Debian Codegraph @

debian/missing-sources/jiff/CHANGELOG.md

raw symbols SCIP
1 # CHANGELOG
2
3 0.2.18 (2026-01-05)
4 ===================
5 This release ships a sizeable refactor to the RFC 2822, RFC 9110, RC
6 3339, RFC 9557, ISO 8601 and friendly format printers. Specifically,
7 they are now all monomorphic internally (instead of being generic over
8 `jiff::fmt::Write`) and write to uninitialized buffers. This improves
9 runtime performance (sometimes dramatically so), and to a more modest
10 degree, decreases binary size and improves compile times.
11
12 This release also includes a bug fix where `DateTime::MIN.to_zoned(..)`
13 could panic.
14
15 Enhancements:
16
17 * [#460](https://github.com/BurntSushi/jiff/pull/460):
18 Improve runtime performance and binary size of RFC 2822 printer.
19 * [#461](https://github.com/BurntSushi/jiff/pull/461):
20 Tweak behavior of printing min/max offsets in RFC 2822 and Temporal printers.
21 * [#462](https://github.com/BurntSushi/jiff/pull/462):
22 Export fallible constructors for `jiff::SignedDuration`.
23 * [#465](https://github.com/BurntSushi/jiff/pull/465):
24 Improve runtime performance and binary size of the "friendly" duration printer.
25 * [#468](https://github.com/BurntSushi/jiff/pull/468):
26 Improve runtime performance and binary size of the Temporal ISO 8601 duration
27 printer.
28 * [#470](https://github.com/BurntSushi/jiff/pull/470):
29 Improve runtime performance and binary size of the Temporal ISO 8601 datetime
30 printer.
31 * [#474](https://github.com/BurntSushi/jiff/pull/474):
32 Improve runtime performance and binary size of Jiff's `strftime`
33 implementation.
34 * [#477](https://github.com/BurntSushi/jiff/pull/477):
35 Fix a bug where time zone lookups for `civil::DateTime::MIN` could panic.
36
37
38 0.2.17 (2025-12-24)
39 ===================
40 This release contains binary size improvements to Jiff, more succinct error
41 messages and some new minor APIs.
42
43 While Jiff 1.0 is overdue, I've been doing a lot of experimenting with
44 improving Jiff's binary size and compile times. In particular, I want to spend
45 time doing this before Jiff 1.0 so that we don't box ourselves into a corner.
46 (For example, some binary size improvements may require minor API breaking
47 changes.)
48
49 In this release, Jiff has switched to structured error handling internally
50 in an effort to provide error predicates and also hopefully improve binary
51 sizes and compile times. Overall this didn't have as big of an impact on
52 binary sizes or compile times as I was hoping. I did take this opportunity to
53 make Jiff's error messages a bit more succinct. In many cases, this involved
54 de-duplicating some aspects of error messages and omitting user provided input
55 in the messages. If you feel like there is a significant decrease in error
56 message quality that isn't easily amended by callers providing additional
57 context themselves, please open an issue.
58
59 This release also updates Jiff's bundled copy of the [IANA Time Zone Database]
60 to `2025c`. See the [`2025c` release announcement] for more details.
61
62 Enhancements:
63
64 * [#412](https://github.com/BurntSushi/jiff/issues/412):
65 Add `Display`, `FromStr`, `Serialize` and `Deserialize` trait implementations
66 for `jiff::civil::ISOWeekDate`. These all use the ISO 8601 week date format.
67 * [#418](https://github.com/BurntSushi/jiff/issues/418):
68 Add some basic predicates to `jiff::Error` for basic error introspection.
69 * [#453](https://github.com/BurntSushi/jiff/pull/453),
70 [#454](https://github.com/BurntSushi/jiff/pull/454):
71 Switch to structured error handling internally.
72 * [#456](https://github.com/BurntSushi/jiff/pull/456),
73 [#457](https://github.com/BurntSushi/jiff/pull/457),
74 [#458](https://github.com/BurntSushi/jiff/pull/458):
75 Various improvements to binary size.
76
77 [`2025c` release announcement]: https://lists.iana.org/hyperkitty/list/[email protected]/thread/TAGXKYLMAQRZRFTERQ33CEKOW7KRJVAK/
78
79
80 0.2.16 (2025-11-07)
81 ===================
82 This release contains a number of enhancements and bug fixes that have accrued
83 over the last few months. Most are small polishes. A couple of the bug fixes
84 apply to panics that could occur when parsing invalid `TZ` strings or invalid
85 `strptime` format strings.
86
87 Also, parsing into a `Span` should now be much faster (for both the ISO 8601
88 and "friendly" duration formats).
89
90 Enhancements:
91
92 * [#298](https://github.com/BurntSushi/jiff/issues/298):
93 Add Serde helpers for (de)serializing `std::time::Duration` values.
94 * [#396](https://github.com/BurntSushi/jiff/issues/396):
95 Add `Sub` and `Add` trait implementations for `Zoned` (in addition to the
96 already existing trait implementations for `&Zoned`).
97 * [#397](https://github.com/BurntSushi/jiff/pull/397):
98 Add `BrokenDownTime::set_meridiem` and ensure it overrides the hour when
99 formatting.
100 * [#409](https://github.com/BurntSushi/jiff/pull/409):
101 Switch dependency on `serde` to `serde_core`. This should help speed up
102 compilation times in some cases.
103 * [#430](https://github.com/BurntSushi/jiff/pull/430):
104 Add new `Zoned::series` API, making it consistent with the same API on other
105 datetime types.
106 * [#432](https://github.com/BurntSushi/jiff/pull/432):
107 When `lenient` mode is enabled for `strftime`, Jiff will no longer error when
108 the formatting string contains invalid UTF-8.
109 * [#432](https://github.com/BurntSushi/jiff/pull/432):
110 Formatting of `%y` and `%g` no longer fails based on the specific year value.
111 * [#432](https://github.com/BurntSushi/jiff/pull/432):
112 Parsing of `%s` is now a bit more consistent with other fields. Moreover,
113 `BrokenDownTime::{to_timestamp,to_zoned}` will now prefer timestamps parsed
114 with `%s` over any other fields that have been parsed.
115 * [#433](https://github.com/BurntSushi/jiff/pull/433):
116 Allow parsing just a `%s` into a `Zoned` via the `Etc/Unknown` time zone.
117
118 Bug fixes:
119
120 * [#386](https://github.com/BurntSushi/jiff/issues/386):
121 Fix a bug where `2087-12-31T23:00:00Z` in the `Africa/Casablanca` time zone
122 could not be round-tripped (because its offset was calculated incorrectly as
123 a result of not handling "permanent DST" POSIX time zones).
124 * [#407](https://github.com/BurntSushi/jiff/issues/407):
125 Fix a panic that occurred when parsing an empty string as a POSIX time zone.
126 * [#410](https://github.com/BurntSushi/jiff/issues/410):
127 Fix a panic that could occur when parsing `%:` via `strptime` APIs.
128 * [#414](https://github.com/BurntSushi/jiff/pull/414):
129 Update some parts of the documentation to indicate that `TimeZone::unknown()`
130 is a fallback for `TimeZone::system()` (instead of the `jiff 0.1` behavior of
131 using `TimeZone::UTC`).
132 * [#423](https://github.com/BurntSushi/jiff/issues/423):
133 Fix a panicking bug when reading malformed TZif data.
134 * [#426](https://github.com/BurntSushi/jiff/issues/426):
135 Fix a panicking bug when parsing century (`%C`) via `strptime`.
136 * [#445](https://github.com/BurntSushi/jiff/pull/445):
137 Fixed bugs with parsing durations like `-9223372036854775808s`
138 and `-PT9223372036854775808S`.
139
140 Performance:
141
142 * [#445](https://github.com/BurntSushi/jiff/pull/445):
143 Parsing into `Span` or `SignedDuration` is now a fair bit faster in some cases.
144
145
146 0.2.15 (2025-06-13)
147 ===================
148 This release fixes a bug where error values were being constructed during
149 parsing even in the success case. This was a regression introduced in `0.2.14`
150 as a result of trying to improve compilation times. Thankfully, fixing this
151 regression doesn't seem to meaningfully impact the amount of IR generated by
152 compiling Jiff.
153
154 Bug fixes:
155
156 * [#385](https://github.com/BurntSushi/jiff/pull/385):
157 Fixes a performance regression for parsing.
158
159
160 0.2.14 (2025-05-20)
161 ===================
162 This release includes a smattering of bug fixes, and hopefully a small
163 improvement to the time it takes to compile Jiff. Also, in this release, when
164 `TZ` is set to a non-empty but invalid value, Jiff will always fall back to
165 `Etc/Unknown` when using `TimeZone::system()`. This differs from previous
166 behavior where Jiff would, in this case, attempt to read the system's default
167 time zone. This change brings Jiff into consistency with existing Unix tooling
168 like `date`, and is also arguably a better failure mode. That is, when `TZ` is
169 set but invalid, we shouldn't silently fall back to the default system time
170 zone, but instead do something that indicates something has potentially gone
171 wrong.
172
173 Enhancements:
174
175 * [#364](https://github.com/BurntSushi/jiff/issues/364):
176 Jiff now falls back to `Etc/Unknown` for invalid `TZ` values.
177 * [#379](https://github.com/BurntSushi/jiff/pull/379):
178 Improve compilation times.
179
180 Bug fixes:
181
182 * [#365](https://github.com/BurntSushi/jiff/issues/365):
183 Fixes a compile error in Jiff when only the `tzdb-concatenated` feature was
184 enabled.
185 * [#366](https://github.com/BurntSushi/jiff/issues/366):
186 Fixes slow initial `Zoned::now()` in environments where `/usr/share/zoneinfo`
187 is on a very slow file system (like CI environments).
188 * [#376](https://github.com/BurntSushi/jiff/issues/376):
189 Avoids searching for a tzdb at `/usr/share/zoneinfo` on Windows.
190
191
192 0.2.13 (2025-05-05)
193 ===================
194 This release fixes a bug in a corner case where `TimeZone::following` could
195 sometimes omit the last time zone transition. This could only happen in time
196 zones that once had daylight saving time, but ended it. This did not have an
197 impact on other Jiff APIs that handle daylight saving time.
198
199 Bug fixes:
200
201 * [#362](https://github.com/BurntSushi/jiff/issues/362):
202 Fix a bug where `TimeZone::following` could omit the last historical time zone
203 transition.
204
205
206 0.2.12 (2025-05-03)
207 ===================
208 This release fixes a couple bugs in Jiff's parser. In particular, a regression
209 was introduced in `jiff 0.2.11` where its RFC 2822 parser could panic on some
210 inputs. Previous releases of Jiff are unaffected.
211
212 Bug fixes:
213
214 * [#357](https://github.com/BurntSushi/jiff/issues/357):
215 Fix a bug where parsing `1970-06-01T00-00:45:00[Africa/Monrovia]` succeeded
216 but it should fail.
217 * [#359](https://github.com/BurntSushi/jiff/issues/359):
218 Fix a bug where the RFC 2822 parser could panic on some inputs.
219
220
221 0.2.11 (2025-05-01)
222 ===================
223 This release includes new APIs for customizing Jiff's `strtime` behavior along
224 with a few minor bug fixes. Jiff's `strtime` formatting API has also been
225 optimized. It's about twice as fast as it was.
226
227 This release also coincides with the publication of `jiff-icu 0.2.0-beta.2`,
228 which has support for `icu 2.0.0-beta.2`.
229
230 Enhancements:
231
232 * [#338](https://github.com/BurntSushi/jiff/pull/338):
233 Add support for the `%c`, `%r`, `%X` and `%x` conversion specifiers.
234 * [#341](https://github.com/BurntSushi/jiff/issues/341):
235 Add support for `%q` in `jiff::fmt::strtime` (prints quarter of year).
236 * [#342](https://github.com/BurntSushi/jiff/issues/342):
237 Add support for `%::z` and `%:::z` in `jiff::fmt::strtime`.
238 * [#344](https://github.com/BurntSushi/jiff/issues/344):
239 Add support for `%N` in `jiff::fmt::strtime` (alias for `%9f`).
240 * [#350](https://github.com/BurntSushi/jiff/issues/350):
241 Add a "lenient" mode for `strtime` formatting APIs that ignores most errors.
242
243 Bug fixes:
244
245 * [#328](https://github.com/BurntSushi/jiff/issues/328):
246 Document default precision behavior of `Display` impls for datetime types.
247 * [#340](https://github.com/BurntSushi/jiff/issues/340):
248 Allow whitespace in more places in RFC 2822 parser (improves spec compliance).
249 * [#346](https://github.com/BurntSushi/jiff/issues/346):
250 `TimeZone::get("UTC")` should now always return `TimeZone::UTC`.
251
252 Performance:
253
254 * [#338](https://github.com/BurntSushi/jiff/pull/338):
255 Jiff's `strftime` APIs are now approximately twice as fast as they were.
256 Performance should be comparable to `chrono` and `time`'s prebuilt APIs.
257
258
259 0.2.10 (2025-04-21)
260 ===================
261 This release includes a bug fix for parsing `Tuesday` when using `%A` via
262 Jiff's `strptime` APIs. Specifically, it would recognize `Tueday` instead of
263 `Tuesday`.
264
265 Bug fixes:
266
267 * [#333](https://github.com/BurntSushi/jiff/issues/333):
268 Fix typo in `strptime` parsing from `Tueday` to `Tuesday`.
269
270
271 0.2.9 (2025-04-19)
272 ==================
273 This release includes a bug fix that, in debug mode, could result in datetime
274 types having different hashes for the same value. This could cause problems,
275 for example, if you are using datetimes as keys in a hash map. This problem
276 didn't exist when Jiff was compiled in release mode.
277
278 This release also improves the panic message shown when the `js` feature isn't
279 enabled and the current time is requested on `wasm32-unknown-unknown` targets.
280
281 Enhancements:
282
283 * [#296](https://github.com/BurntSushi/jiff/issues/296):
284 Provide a better panic message when `Zoned::now()` fails on WASM.
285
286 Bug fixes:
287
288 * [#330](https://github.com/BurntSushi/jiff/issues/330):
289 Fix bug where `Hash` on datetime types could yield different hash values for
290 the same underlying date/time.
291
292
293 0.2.8 (2025-04-13)
294 ==================
295 This release fixes a bug where the constructors on `SignedDuration`
296 for floating point durations could panic (in debug mode) or produce
297 incorrect results (in release mode). This bug only impacts users of
298 the `try_from_secs_{f32,f64}` and `from_secs_{f32,f64}` methods on
299 `SignedDuration`.
300
301 Enhancements:
302
303 * [#326](https://github.com/BurntSushi/jiff/pull/326):
304 Add an alternate `Debug` impl for `SignedDuration` that only shows its second
305 and nanosecond components (while using only one component when the other is
306 zero).
307
308 Bug fixes:
309
310 * [#324](https://github.com/BurntSushi/jiff/issues/324):
311 Fix a bug that could produce a panic or incorrect results in
312 `SignedDuration::(try_)?from_secs_{f32,f64}`.
313
314
315 0.2.7 (2025-04-13)
316 ==================
317 This release includes a bug fix that changes how an empty but set `TZ`
318 environment variable is interpreted (as indistinguishable from `TZ=UTC`).
319 This also includes a new enabled by default create feature, `perf-inline`,
320 which allows toggling Jiff's use of `inline(always)`. This may help improve
321 compile times or decrease binary size.
322
323 Enhancements:
324
325 * [#320](https://github.com/BurntSushi/jiff/pull/320):
326 Remove some internal uses of generics to mildly improve compile times.
327 * [#321](https://github.com/BurntSushi/jiff/pull/321):
328 Add `perf-inline` crate feature for controlling `inline(always)` annotations.
329
330 Bug fixes:
331
332 * [#311](https://github.com/BurntSushi/jiff/issues/311):
333 Make `TZ=` indistinguishable from `TZ=UTC`.
334
335
336 0.2.6 (2025-04-07)
337 ==================
338 This release includes a few bug fixes and support for discovering the IANA Time
339 Zone Database automatically on Illumos.
340
341 Enhancements:
342
343 * [#315](https://github.com/BurntSushi/jiff/issues/315):
344 Add support for automatically finding the tzdb on Illumos.
345
346 Bug fixes:
347
348 * [#305](https://github.com/BurntSushi/jiff/issues/305):
349 Fixed `Zoned` rounding on days with DST time zone transitions.
350 * [#309](https://github.com/BurntSushi/jiff/issues/309):
351 Fixed bug where `TimeZone::preceding` could omit historical time zone
352 transitions for time zones that have eliminated DST in the present.
353 * [#312](https://github.com/BurntSushi/jiff/issues/312):
354 Fixed `nth_weekday_in_month`, where it would sometimes incorrectly return an
355 error.
356
357
358 0.2.5 (2025-03-22)
359 ==================
360 This release updates Jiff's bundled copy of the [IANA Time Zone Database] to
361 `2025b`. See the [`2025b` release announcement] for more details.
362
363 Enhancements:
364
365 * [#300](https://github.com/BurntSushi/jiff/pull/300):
366 Update `jiff-tzdb` to `2025b`.
367
368 [`2025b` release announcement]: https://lists.iana.org/hyperkitty/list/[email protected]/thread/6JVHNHLB6I2WAYTQ75L6KEPEQHFXAJK3/
369
370
371 0.2.4 (2025-03-10)
372 ==================
373 This is another small release that fixes a problem where Jiff could break
374 builds if they relied on inference for integer comparisons. Specifically, Jiff
375 uses internal trait impls to make comparing its internal ranged integers
376 more convenient. But Rust the language has no concept of "internal" trait
377 impls, and thus this can impact type inference. If code was written in a way
378 that relies on a singular trait impl that is available, then adding Jiff to
379 the project can cause it to break.
380
381 This isn't arguably Jiff's fault per se, but since these trait impls were just
382 about internal convenience and not essential to Jiff's design, we adopt a
383 pragmatic approach and just remove them.
384
385 Bug fixes:
386
387 * [#293](https://github.com/BurntSushi/jiff/issues/293):
388 Remove internal trait impls that can cause breaks due to inference failures.
389
390
391 0.2.3 (2025-03-07)
392 ==================
393 This is a small release that fixes a bug in the handling of POSIX time zones
394 in some cases. Specifically, the implementation of `Date::yesterday` was wrong
395 when the date was the first of the month. This was a regression introduced in
396 `0.2.2` and was not present in older releases. More test coverage has been
397 added.
398
399 Bug fixes:
400
401 * [#290](https://github.com/BurntSushi/jiff/issues/290):
402 Fix bug in implementation of `Date::yesterday`.
403
404
405 0.2.2 (2025-03-06)
406 ==================
407 This release of Jiff includes a new opt-in proc macro for embedding a
408 `TimeZone` into your binary. Just enable Jiff's `static` feature, and this will
409 print the current time in the `America/New_York` time zone:
410
411 ```rust
412 use jiff::{
413 tz::{self, TimeZone},
414 Timestamp,
415 };
416
417 fn main() {
418 static TZ: TimeZone = tz::get!("America/New_York");
419 let zdt = Timestamp::now().to_zoned(TZ.clone());
420 println!("{zdt}");
421 }
422 ```
423
424 This enables `TimeZone` to be meaningfully used in core-only environments,
425 even when dynamic memory allocation isn't available.
426
427 This release also features a number of performance improvements for time zone
428 lookups. In some cases, the improvement is significant (by an order of
429 magnitude).
430
431 Additionally, the IANA Time Zone Database embedded into `jiff-tzdb` now
432 uses "rearguard" semantics. This means that the boolean flag indicating
433 whether daylight saving time is active or not (only accessible via
434 `TimeZone::to_offset_info`) will respect the actual definition of
435 daylight saving time. (This is relevant, for example, for time zones like
436 `Europe/Dublin`, where their summer time is _legally_ known as their standard
437 time, but is in effect daylight saving time.)
438
439 Enhancements:
440
441 * [#256](https://github.com/BurntSushi/jiff/issues/256):
442 Add `tz::{get,include}` macros for time zone support in core-only environments.
443 * [#258](https://github.com/BurntSushi/jiff/issues/258):
444 Switch to `rearguard` tzdb data in `jiff-tzdb` and document it.
445 * [#259](https://github.com/BurntSushi/jiff/pull/259):
446 De-duplicate TZif data in `jiff-tzdb`.
447 * [#273](https://github.com/BurntSushi/jiff/issues/273):
448 Add "crate features" documentation to `jiff-sqlx` and `jiff-diesel`.
449 * [#277](https://github.com/BurntSushi/jiff/issues/277):
450 Document semver guarantee for error conditions on `Timestamp` constructors.
451 * [#277](https://github.com/BurntSushi/jiff/pull/287):
452 Greatly optimize time zone lookups (for both timestamps and civil datetimes).
453
454 Bug fixes:
455
456 * [#261](https://github.com/BurntSushi/jiff/issues/261):
457 Improve the documentation for `ZonedWith::nanosecond` and
458 `ZonedWith::subsec_nanosecond`.
459
460
461 0.2.1 (2025-02-16)
462 ==================
463 This release includes a massive number of optimizations that significantly
464 improves performance in some cases. If you had a workload whose performance
465 with Jiff was underwhelming, please give it a try. I welcome questions via
466 [Discussions on GitHub].
467
468 This release also provides a new API, `Timestamp::constant`, for constructing
469 `Timestamp` values in a `const` context.
470
471 Enhancements:
472
473 * [#235](https://github.com/BurntSushi/jiff/discussions/235),
474 [#255](https://github.com/BurntSushi/jiff/discussions/255),
475 [#266](https://github.com/BurntSushi/jiff/pull/266):
476 A massive number of performance improvements. Jiff should now generally be
477 faster than `chrono` and `time`.
478 * [#263](https://github.com/BurntSushi/jiff/issues/263):
479 Add `Timestamp::constant` for constructing timestamps in `const` context.
480
481
482 0.2.0 (2025-02-10)
483 ==================
484 This is a new semver incompatible release of Jiff. It contains several breaking
485 changes. I expect most users of Jiff to be able to upgrade without any changes.
486 The fundamental API organization of Jiff has not changed.
487
488 Some of the highlights of this release include reducing footguns and better
489 ecosystem integration.
490
491 For reducing footguns, APIs on `Span` will no longer implicitly assume that
492 days are always 24 hours long. And `Span` no longer implements `PartialEq` or
493 `Eq` (instead favoring `span.fieldwise()` to create a value that supports naive
494 fieldwise comparison). Moreover, when using `TimeZone::system()` (perhaps via
495 `Zoned::now()`), if the system time zone could not be detected, then a special
496 `Etc/Unknown` time zone will be used instead. This avoids erroring, but also
497 surfaces itself to make it clearer that something has (perhaps) gone wrong.
498
499 As for ecosystem integration, this release coincides with the publication
500 of the [`jiff-icu`], [`jiff-sqlx`] and [`jiff-diesel`] crates. `jiff-icu`
501 integrates with the [ICU4X project], and is now the recommended way to use
502 Jiff to work with non-Gregorian calendars or to localize datetimes for end
503 users. `jiff-sqlx` and `jiff-diesel` provide wrapper types that implement the
504 necessary traits to make it ergonomic to store and retrieve Jiff values in a
505 database using [SQLx] or [Diesel], respectively.
506
507 Unless something unexpected happens, my plan is for the next breaking change
508 release to be Jiff 1.0 in about 6 months. Once Jiff 1.0 is out, I plan to
509 commit to it indefinitely.
510
511 **BREAKING CHANGES**:
512
513 This is an exhaustive list of breaking changes. Changes with the bolded
514 **RUNTIME** prefix are changes that will not be caught by the Rust compiler.
515 That is, they are changes in runtime behavior.
516
517 * [#28](https://github.com/BurntSushi/jiff/issues/28):
518 The deprecated `intz` routines on `Zoned`, `Timestamp`, `civil::DateTime` and
519 `civil::Date` have been removed. You can use `in_tz` instead. This change was
520 made because many found the name `intz` to be unclear.
521 * [#32](https://github.com/BurntSushi/jiff/issues/32):
522 The `PartialEq` and `Eq` trait implementations on `Span` have been removed.
523 Ideally these shouldn't have been used, but if you do need them, please use
524 `Span::fieldwise` to create a `SpanFieldwise`, which does have the `PartialEq`
525 and `Eq` traits implemented. These were removed on `Span` itself because they
526 made it very easy to commit subtle bugs.
527 * [#36](https://github.com/BurntSushi/jiff/issues/36):
528 Turn panics during `Timestamp::saturing_add` into errors. Callers adding
529 spans that are known to contain units of hours or smaller are guaranteed that
530 this will not return an error.
531 * **RUNTIME** [#48](https://github.com/BurntSushi/jiff/issues/48):
532 On `Span` APIs, days are no longer silently assumed to always be 24 hours when
533 a relative datetime is not provided. Instead, to perform operations on units
534 of days or bigger, callers must either provide a relative date or opt into
535 invariant 24-hour days with `SpanRelativeTo::days_are_24_hours`. Shortcuts have
536 been added to the span builders. For example, `SpanTotal::days_are_24_hours`.
537 * **RUNTIME** [#147](https://github.com/BurntSushi/jiff/issues/147):
538 Change the behavior of the deprecated `%V` conversion specifier in
539 `jiff::fmt::strtime` from formatting an IANA time zone identifier to formatting
540 an ISO 8601 week number. To format an IANA time zone identifier, use `%Q` or
541 `%:Q` (which were introduced in `jiff 0.1`).
542 * **RUNTIME** [#212](https://github.com/BurntSushi/jiff/issues/212):
543 When parsing into a `Zoned` with a civil time corresponding to a gap, we treat
544 all offsets as invalid and return an error. Previously, we would accept the
545 offset as given. This brings us into line with Temporal's behavior. For
546 example, previously Jiff accepted `2006-04-02T02:30-05[America/Indiana/Vevay]`
547 but will now return an error. This is desirable for cases where a datetime in
548 the future is serialized before a change in the daylight saving time rules.
549 For more examples, see `jiff::fmt::temporal::DateTimeParser::offset_conflict`
550 for details on how to change Jiff's default behavior. This behavior change also
551 applies to `tz::OffsetConflict::PreferOffset`.
552 * **RUNTIME** [#213](https://github.com/BurntSushi/jiff/issues/213):
553 Tweak the semantics of `tz::TimeZoneDatabase` so that it only initializes one
554 internal tzdb instead of trying to find as many as possible. It is unlikely
555 that you'll be impacted by this change, but it's meant to make the semantics
556 be a bit more sensible. (In `jiff 0.1`, it was in theory possible for one tz
557 lookup to succeed in the system zoneinfo and then another tz lookup to fail
558 in zoneinfo but succeed automatically via the bundled copy. But this seems
559 confusing and possibly not desirable. Hence the change.)
560 * [#218](https://github.com/BurntSushi/jiff/issues/218):
561 In order to make naming a little more consistent between `Zoned`
562 and `civil::Date`, the `civil::Date::to_iso_week_date` and
563 `civil::ISOWeekDate::to_date` APIs were renamed to `civil::Date::iso_week_date`
564 and `civil::ISOWeekDate::date`.
565 * [#220](https://github.com/BurntSushi/jiff/issues/220):
566 Remove `Span::to_duration` for converting a `Span` to a `std::time::Duration`
567 and rename `Span::to_jiff_duration` to `Span::to_duration`. This prioritizes
568 `SignedDuration` as the "primary" non-calendar duration type in Jiff. And makes
569 it more consistent with APIs like `Zoned::duration_since`. For non-calendar
570 spans, the `TryFrom<Span> for std::time::Duration` still exists. For calendar
571 durations, use `Span::to_duration` and then convert the `SignedDuration` to
572 `std::time::Duration`. Additionally, `Timestamp::from_jiff_duration` and
573 `Timestamp::as_jiff_duration` were renamed to `Timestamp::from_duration` and
574 `Timestamp::as_duration`, respectively. The old deprecated routines on the
575 unsigned `std::time::Duration` have been removed.
576 * [#221](https://github.com/BurntSushi/jiff/issues/221):
577 Change the type of the value yielded by the `jiff::tz::TimeZoneNameIter`
578 iterator from `String` to `jiff::tz::TimeZoneName`. This opaque type is more
579 API evolution friendly. To access the string, either use `TimeZoneName`'s
580 `Display` trait implementation, or its `as_str` method.
581 * [#222](https://github.com/BurntSushi/jiff/issues/222):
582 Split `TimeZone::to_offset` into two methods. One that just returns the
583 offset, and another, `TimeZone::to_offset_info`, which includes the offset,
584 DST status and time zone abbreviation. The extra info is rarely needed and
585 is sometimes more costly to compute. Also, make the lifetime of the time
586 zone abbreviation returned by `TimeZoneTransition::abbreviation` tied to
587 the transition instead of the time zone (for future API flexibility, likely
588 in core-only environments). This change was overall motivated by wanting to
589 do less work in the common case (where we only need the offset), and for
590 reducing the size of a `TimeZone` considerably in core-only environments.
591 Callers previously using `TimeZone::to_offset` to get DST status and time zone
592 abbreviation should now use `TimeZone::to_offset_info`.
593 * **RUNTIME** [#230](https://github.com/BurntSushi/jiff/issues/230):
594 When `TimeZone::system()` cannot find a system configured time zone, `jiff
595 0.1` would automatically fall back to `TimeZone::UTC` (with a WARN-level log
596 message). In `jiff 0.2`, the fall back is now to `TimeZone::unknown()`, which
597 has a special `Etc/Unknown` identifier (as specified by Unicode and reserved by
598 the IANA time zone database). The fallback otherwise still behaves as if it
599 were `TimeZone::UTC`. This helps surface error conditions related to finding
600 the system time zone without causing unrecoverable failure.
601
602 Enhancements:
603
604 * [#136](https://github.com/BurntSushi/jiff/issues/136):
605 When the special `SpanRelativeTo::days_are_24_hours()` marker is used, weeks
606 will also be treated as invariant. That is, seven 24-hour days. In all cases,
607 working with years and months still requires a relative date.
608 * [#228](https://github.com/BurntSushi/jiff/issues/228):
609 It is now possible to forcefully use a bundled copy of the IANA time zone
610 database without relying on disabling crate features. This can be done by
611 enabling the `tzdb-bundle-always` crate feature and explicitly creating a
612 `jiff::tz::TimeZoneDatabase::bundled()` database. Once in hand, you must use
613 APIs like `TimeZoneDatabase::get` to create a `TimeZone` and avoid any APIs
614 that implicitly use the global time zone database (like `Timestamp::in_tz` or
615 even `Zoned::from_str`).
616 * [#238](https://github.com/BurntSushi/jiff/pull/238):
617 Add integration with the ICU4X project via the [`jiff-icu`] crate. `jiff-icu`
618 provides traits for easily converting between datetime types defined in Jiff
619 and datetime types defined in ICU4X.
620 * [#240](https://github.com/BurntSushi/jiff/pull/240):
621 Add integration with the SQLx project via the [`jiff-sqlx`] crate. `jiff-sqlx`
622 provides wrapper types that implement the necessary traits in SQLx for
623 reasonably ergonomic integration. This includes PostgreSQL and SQLite support,
624 but not MySQL support. (It's not clear if it's possible at present to provide
625 MySQL support for SQLx for datetime types outside of SQLx itself.)
626 * [#241](https://github.com/BurntSushi/jiff/pull/241):
627 Add integration with the Diesel project via the [`jiff-diesel`] crate.
628 `jiff-diesel` provides wrapper types that implement the necessary traits in
629 Diesel for reasonably ergonomic integration. This includes MySQL, PostgreSQL
630 and SQLite support.
631
632
633 0.1.29 (2025-02-02)
634 ===================
635 This release includes a few small enhancements and a bug fix. In particular,
636 there is now Serde support for `TimeZone` and the `ISOWeekDate` API has been
637 filled out a bit more.
638
639 Unless a serious issue is uncovered, my plan is that this will be the last
640 release before `jiff 0.2`.
641
642 Enhancements:
643
644 * [#89](https://github.com/BurntSushi/jiff/issues/89):
645 Opt-in support for using Serde with `jiff::tz::TimeZone` has been added.
646 * [#227](https://github.com/BurntSushi/jiff/issues/227):
647 The `civil::ISOWeekDate` API has been beefed up with a few convenience methods.
648 * [#233](https://github.com/BurntSushi/jiff/issues/233):
649 Add `tz::Offset::round` for rounding time zone offsets.
650
651 Bug fixes:
652
653 * [#231](https://github.com/BurntSushi/jiff/issues/231):
654 Use more flexible offset equality when parsing offsets with fractional minutes.
655
656
657 0.1.28 (2025-01-27)
658 ===================
659 This is a small release that just removes the dev-dependency on `serde_yml`.
660 It has been replaced with the deprecated `serde_yaml`. See
661 [this post about `serde_yml` shenanigans](https://x.com/davidtolnay/status/1883906113428676938)
662 for why this was done. Note that this was only a dev-dependency and thus doesn't
663 impact folks using Jiff.
664
665 Bug fixes:
666
667 * [#225](https://github.com/BurntSushi/jiff/pull/225):
668 Remove dependency on `serde_yml` in favor of `serde_yaml`.
669
670
671 0.1.27 (2025-01-25)
672 ===================
673 This is a small release with a bug fix for precision loss in some cases when
674 doing arithmetic on `Timestamp` or `Zoned`.
675
676 Bug fixes:
677
678 * [#223](https://github.com/BurntSushi/jiff/issues/223):
679 Fix the check for fractional seconds before taking the fast path.
680
681
682 0.1.26 (2025-01-23)
683 ===================
684 This is a small release with another deprecation and a new API for doing
685 prefix parsing via `strptime`. There's also a bug fix for a corner case
686 when dealing with daylight saving time gaps with the `Zoned::with` API.
687
688 Deprecations:
689
690 * [#210](https://github.com/BurntSushi/jiff/pull/210):
691 Deprecate `ISOWeekDate::to_date` in favor of `ISOWeekDate::date`.
692
693 Enhancements:
694
695 * [#209](https://github.com/BurntSushi/jiff/issues/209):
696 Add `fmt::strtime::BrokenDownTime::parse_prefix` for parsing only a prefix.
697
698 Bug fixes:
699
700 * [#211](https://github.com/BurntSushi/jiff/issues/211):
701 Fix unintuitive behavior of `Zoned::with` when time falls in a DST gap.
702
703
704 0.1.25 (2025-01-21)
705 ===================
706 This release contains a number of deprecations in preparation for a `jiff 0.2`
707 release. The deprecations are meant to facilitate a smoother transition. The
708 deprecations, when possible, come with new APIs that will permit users to write
709 forward compatible code that will work in both `jiff 0.1` and `jiff 0.2`.
710
711 This release also includes a handful of new conversion specifiers in Jiff's
712 `strftime` and `strptime` APIs. This improves compatibility with the analogous
713 implementation with GNU libc.
714
715 Deprecations:
716
717 * [#28](https://github.com/BurntSushi/jiff/issues/28):
718 The `intz` methods on `Zoned`, `Timestamp`, `civil::DateTime` and `civil::Date`
719 have been deprecated in favor of `in_tz`.
720 * [#32](https://github.com/BurntSushi/jiff/issues/32):
721 The `Eq` and `PartialEq` trait implementations on `Span` have been deprecated
722 in favor of using the new `SpanFieldwise` type.
723 * [#48](https://github.com/BurntSushi/jiff/issues/48):
724 Silently assuming days are always 24 hours in some `Span` APIs has now been
725 deprecated. This will become an error in `jiff 0.2`. To continue assuming
726 days are 24 hours without a relative reference date, you can use the new
727 `SpanRelativeTo::days_are_24_hours` API. In `jiff 0.1`, you'll seen a
728 WARN-level log message emitted if you're code will be broken by `jiff 0.2`.
729 * [#147](https://github.com/BurntSushi/jiff/issues/147):
730 Both `%V` and `%:V` have been deprecated in favor of `%Q` and `%:Q`. In
731 `jiff 0.2`, `%V` will correspond to the ISO 8601 week number and `%:V` will
732 result in an error. This change was made to improve compatibility with other
733 `strtime` implementations. `%V` and `%:V` continue to correspond to IANA
734 time zone identifiers in `jiff 0.1`, but using them for parsing or formatting
735 will result in a WARN-level deprecation message.
736
737 Enhancements:
738
739 * [#147](https://github.com/BurntSushi/jiff/issues/147):
740 Adds a number of new conversion specifiers to Jiff's `strftime` and
741 `strptime` APIs. Specifically, `%C`, `%G`, `%g`, `%j`, `%k`, `%l`, `%n`, `%R`,
742 `%s`, `%t`, `%U`, `%u`, `%W`, `%w`. Their behavior should match the
743 corresponding specifiers in GNU libc.
744
745
746 0.1.24 (2025-01-16)
747 ===================
748 This release updates Jiff's bundled copy of the [IANA Time Zone Database] to
749 `2025a`. See the [`2025a` release announcement] for more details.
750
751 Enhancements:
752
753 * [#206](https://github.com/BurntSushi/jiff/pull/206):
754 Update `jiff-tzdb` to `2025a`.
755
756 [`2025a` release announcement]: https://lists.iana.org/hyperkitty/list/[email protected]/thread/MWII7R3HMCEDNUCIYQKSSTYYR7UWK4OQ/
757
758
759 0.1.23 (2025-01-13)
760 ===================
761 This release includes some bug fixes, particularly for compilation on
762 `aarch64-linux-android`. There are also some minor enhancements, such as making
763 `Zoned::iso_week_date` a convenience function for `civil::Date::iso_week_date`,
764 in line with similar functions.
765
766 My current plan is to make a reasonably quick transition to `jiff 0.2` with a
767 few pending breaking changes. I will be making some `jiff 0.1` releases with
768 deprecations in order to make the transition as smooth as possible. If all goes
769 well with `jiff 0.2`, then my plan is still to do a Jiff 1.0 release in the
770 Summer of 2025.
771
772 Deprecations:
773
774 * [#197](https://github.com/BurntSushi/jiff/discussions/197):
775 `Date::to_iso_week_date` has been deprecated in favor of `Date::iso_week_date`.
776
777 Enhancements:
778
779 * [#196](https://github.com/BurntSushi/jiff/discussions/196):
780 Improve ISO week date documentation regarding weekday offsets.
781 * [#197](https://github.com/BurntSushi/jiff/discussions/197):
782 Add `Zoned::iso_week_date`, `DateTime::iso_week_date` and
783 `Date::iso_week_date`.
784
785 Bug fixes:
786
787 * [#200](https://github.com/BurntSushi/jiff/issues/200):
788 Fix compilation failure on Android in a Termux shell.
789 * [#202](https://github.com/BurntSushi/jiff/pull/202):
790 Re-add license files to crate artifact.
791
792
793 0.1.22 (2025-01-12)
794 ===================
795 This release adds support for Android. This support means that Jiff will
796 automatically read its special concatenated time zone database, and will
797 read the `persist.sys.timezone` property to determine the system's current
798 time zone.
799
800 See [PLATFORM] for more specific information about Android support.
801
802 Note that this release also removed all non-essential files (including tests
803 and test data) for the artifact uploaded to crates.io. If you need or want
804 these files, please open a new issue.
805
806 Enhancements:
807
808 * [#140](https://github.com/BurntSushi/jiff/issues/140):
809 Add support for the Android platform.
810
811
812 0.1.21 (2025-01-04)
813 ===================
814 This release includes a new API for setting the unit designator label in a
815 friendly formatted duration for zero-length durations.
816
817 Enhancements:
818
819 * [#192](https://github.com/BurntSushi/jiff/issues/192):
820 Add option to the friendly printer for setting the unit when writing a
821 zero-length duration.
822
823
824 0.1.20 (2025-01-03)
825 ===================
826 This release includes a new type, `Pieces`, in the `jiff::fmt::temporal`
827 sub-module. This exposes the individual components of a parsed Temporal
828 ISO 8601 datetime string. It allows users of Jiff to circumvent the checks
829 in the higher level parsing routines that prevent you from shooting yourself
830 in the foot.
831
832 For example, parsing into a `Zoned` will return an error for raw RFC 3339
833 timestamps like `2025-01-03T22:03-05` because there is no time zone annotation.
834 Without a time zone, Jiff cannot do time zone aware arithmetic and rounding.
835 Instead, such a datetime can only be parsed into a `Timestamp`. This lower
836 level `Pieces` API now permits users of Jiff to parse this string into its
837 component parts and assemble it into a `Zoned` if they so choose.
838
839 Enhancements:
840
841 * [#188](https://github.com/BurntSushi/jiff/issues/188):
842 Add `fmt::temporal::Pieces` for granular datetime parsing and formatting.
843
844
845 0.1.19 (2025-01-02)
846 ===================
847 This releases includes a UTF-8 related bug fix and a few enhancements.
848
849 Firstly, a `Span`'s default `Display` implementation now writes uppercase
850 unit designator labels. That means you'll get `P1Y2M3DT4H5M6S` instead
851 of `P1y2m3dT4h5m6s` by default. You can restore previous behavior via
852 `jiff::fmt::temporal::SpanPrinter::lowercase`. This change was made to improve
853 interoperability.
854
855 Secondly, `SignedDuration` now supports rounding via `SignedDuration::round`.
856 Note that it only supports rounding time units (hours or smaller). In order to
857 round with calendar units, you'll still need to use a `Span`.
858
859 Enhancements:
860
861 * [#130](https://github.com/BurntSushi/jiff/issues/130):
862 Document value ranges for methods like `year`, `day`, `hour` and so on.
863 * [#187](https://github.com/BurntSushi/jiff/issues/187):
864 Add a rounding API (for time units only) on `SignedDuration`.
865 * [#190](https://github.com/BurntSushi/jiff/issues/190):
866 `Span` and `SignedDuration` now use uppercase unit designator labels in their
867 default ISO 8601 `Display` implementation.
868
869 Bug fixes:
870
871 * [#155](https://github.com/BurntSushi/jiff/issues/155):
872 Relax `strftime` format strings from ASCII-only to all of UTF-8.
873
874
875 0.1.18 (2024-12-31)
876 ===================
877 This release includes a few minor enhancements. Namely, the ability to iterate
878 over time zone transitions (in the future or the past), and some improvements
879 to failure modes when `Timestamp` and `Span` arithmetic fails.
880
881 Enhancements:
882
883 * [#144](https://github.com/BurntSushi/jiff/issues/144):
884 Add APIs for iterating over the transitions of a time zone.
885 * [#145](https://github.com/BurntSushi/jiff/issues/145):
886 Improve docs and error messages around fallible `Timestamp` arithmetic.
887
888
889 0.1.17 (2024-12-31)
890 ===================
891 This release enhances Jiff's support for `no_std` environments by making its
892 `alloc` feature optional. When `alloc` is disabled, only fixed offset time
893 zones are supported and error messages are significantly degraded. If you have
894 core-only use cases for Jiff, I'd love to hear about them on the issue tracker.
895
896 Enhancements:
897
898 * [#162](https://github.com/BurntSushi/jiff/issues/162):
899 Support platforms that do not have atomics in `std`.
900 * [#168](https://github.com/BurntSushi/jiff/issues/168):
901 Jiff now supports disabling the `alloc` feature, which enables core-only mode.
902 * [#169](https://github.com/BurntSushi/jiff/issues/169):
903 Add `TimeZone::to_fixed_offset` for accessing an invariant offset if possible.
904
905
906 0.1.16 (2024-12-26)
907 ===================
908 This release includes a new `jiff::fmt::friendly` module for formatting and
909 parsing durations in a more human readable format than what ISO 8601 specifies.
910 ISO 8601 remains the "default" duration format in Jiff due to its widespread
911 support. Here are some examples:
912
913 ```text
914 40d
915 40 days
916 1y1d
917 1yr 1d
918 3d4h59m
919 3 days, 4 hours, 59 minutes
920 3d 4h 59m
921 2h30m
922 2h 30m
923 1mo
924 1w
925 1 week
926 1w4d
927 1 wk 4 days
928 1m
929 0.0021s
930 0s
931 0d
932 0 days
933 3 mins 34s 123ms
934 3 mins 34.123 secs
935 3 mins 34,123s
936 1y1mo1d1h1m1.1s
937 1yr 1mo 1day 1hr 1min 1.1sec
938 1 year, 1 month, 1 day, 1 hour, 1 minute 1.1 seconds
939 1 year, 1 month, 1 day, 01:01:01.1
940 ```
941
942 To quickly demonstrate this new feature, here's a simple CLI program using
943 Clap:
944
945 ```ignore
946 use clap::Parser;
947 use jiff::{Span, Zoned};
948
949 #[derive(Parser, Debug)]
950 #[command(version, about, long_about = None)]
951 struct Args {
952 duration: Span,
953 }
954
955 fn main() {
956 let args = Args::parse();
957 println!("adding duration to now: {}", &Zoned::now() + args.duration);
958 }
959 ```
960
961 And running the program:
962
963 ```text
964 $ cargo run -q -- '1 year, 2 months, 5 hours'
965 adding duration to now: 2026-02-26T18:58:22-05:00[America/New_York]
966 $ cargo run -q -- 'P1Y2MT5H' # ISO 8601 durations are supported too!
967 adding duration to now: 2026-02-26T19:00:57-05:00[America/New_York]
968 ```
969
970 With Jiff, you should no longer need to pull in crates like
971 [`humantime`](https://docs.rs/humantime) and
972 [`humantime-serde`](https://docs.rs/humantime-serde)
973 to accomplish a similar task.
974
975 While this new format doesn't support any kind of internationalization, the
976 prevalence of the `humantime` crate suggests there's a desire for something
977 like this. The "friendly" format is meant to service all the same use cases
978 as `humantime` does for durations, but in a way that doesn't let you shoot
979 yourself in the foot.
980
981 The new "friendly" format is now the default for the `Debug` implementations
982 of both `Span` and `SignedDuration`. It's also available via the "alternate"
983 `Display` implementations for `Span` and `SignedDuration` as well. Moreover,
984 the `FromStr` trait implementations for both `Span` and `SignedDuration` will
985 parse _both_ the ISO 8601 duration and this new "friendly" format. Finally,
986 when `serde` integration is enabled, the `Deserialize` implementations for
987 `SignedDuration` and `Span` also automatically parse either ISO 8601 or the
988 friendly format. For serialization, ISO 8601 remains the default, but the
989 `jiff::fmt::serde` module provides easy to use helpers to switch to the
990 friendly format.
991
992 The `jiff::fmt::friendly` module documentation provides many more details,
993 including a complete grammar for the format.
994
995 Enhancements:
996
997 * [#143](https://github.com/BurntSushi/jiff/pull/143):
998 Add `Hash` implementation for `Zoned` and `Timestamp`.
999
1000 Bug fixes:
1001
1002 * [#60](https://github.com/BurntSushi/jiff/issues/60):
1003 Use a better `Debug` output format for `SignedDuration` and `Span`.
1004 * [#111](https://github.com/BurntSushi/jiff/issues/111):
1005 Add a new "friendly" duration format.
1006 * [#138](https://github.com/BurntSushi/jiff/issues/138):
1007 Fix deserialization in `serde_yml` and `serde_yaml` crates.
1008 * [#161](https://github.com/BurntSushi/jiff/pull/161):
1009 Fix `serde` dependency configuration so that it builds in no-std mode.
1010
1011
1012 0.1.15 (2024-11-30)
1013 ===================
1014 This release fixes a bug where Jiff would sometimes fail to parse TZif files
1015 (found, typically, in `/usr/share/zoneinfo` on Unix systems). This occurred
1016 when the TZif file contained a time zone transition outside the range of Jiff's
1017 `Timestamp` type (which is `-9999-01-01` to `9999-12-31`). The bug fix works by
1018 clamping the out-of-range transitions to Jiff's supported range.
1019
1020 This bug only seems to occur in some environments where their TZif files
1021 contain more extreme values than what is typically found.
1022
1023 Bug fixes:
1024
1025 * [#163](https://github.com/BurntSushi/jiff/issues/163):
1026 Fix a bug where Jiff would fail to parse some TZif files.
1027
1028
1029 0.1.14 (2024-11-01)
1030 ===================
1031 This release introduces new APIs to the RFC 2822 printer that explicitly
1032 print timestamps in a format strictly compatible with [RFC 9110].
1033
1034 Enhancements:
1035
1036 * [#151](https://github.com/BurntSushi/jiff/issues/151):
1037 Add `rfc2822::DateTimePrinter::timestamp_to_rfc9110_string` method.
1038
1039
1040 0.1.13 (2024-09-07)
1041 ===================
1042 This release introduces a new `jiff::tz::TimeZone::try_system` API. It is like
1043 `TimeZone::system`, but returns an error instead of an automatic fall back to
1044 UTC when the system time zone could not be discovered.
1045
1046 This also includes an update to the bundled [IANA Time Zone Database] to the
1047 `2024b` release in the `jiff-tzdb` crate. As a reminder, the bundled database
1048 is not used or included on Unix platforms by default. See [PLATFORM] for more
1049 details.
1050
1051 Enhancements:
1052
1053 * [#65](https://github.com/BurntSushi/jiff/issues/65):
1054 Add `TimeZone::try_system` for fallibly determining the system's time zone.
1055 * [#125](https://github.com/BurntSushi/jiff/pull/125):
1056 Update to the `2024b` release of the [IANA Time Zone Database].
1057
1058
1059 0.1.12 (2024-08-31)
1060 ===================
1061 This release introduces some new minor APIs that support formatting
1062 `Timestamp` values as RFC 3339 strings with a specific offset.
1063
1064 Previously, using the standard formatting routines that Jiff provides, it was
1065 only possible to format a `Timestamp` using Zulu time. For example:
1066
1067 ```rust
1068 use jiff::Timestamp;
1069
1070 assert_eq!(
1071 Timestamp::UNIX_EPOCH.to_string(),
1072 "1970-01-01T00:00:00Z",
1073 );
1074 ```
1075
1076 This is fine most use cases, but it can be useful on occasion to format
1077 a `Timestamp` with a specific offset. While this isn't as expressive
1078 as formatting a datetime with a time zone (e.g., with an IANA time
1079 zone identifier), it may be useful in contexts where you just want to
1080 "hint" at what a user's local time is. To that end, there is a new
1081 `Timestamp::display_with_offset` method that makes this possible:
1082
1083 ```rust
1084 use jiff::{tz, Timestamp};
1085
1086 assert_eq!(
1087 Timestamp::UNIX_EPOCH.display_with_offset(tz::offset(-5)).to_string(),
1088 "1969-12-31T19:00:00-05:00",
1089 );
1090 ```
1091
1092 A corresponding API was added to `jiff::fmt::temporal::DateTimePrinter` for
1093 lower level use.
1094
1095 Moreover, this release also includes new convenience APIs on the Temporal and
1096 RFC 2822 printer types for returning strings. For example, previously, if you
1097 were using the RFC 2822 printer to format a `Timestamp`, you had to do this:
1098
1099 ```rust
1100 use jiff::{fmt::rfc2822::DateTimePrinter, Timestamp};
1101
1102 let mut buf = String::new();
1103 DateTimePrinter::new().print_timestamp(&Timestamp::UNIX_EPOCH, &mut buf).unwrap();
1104 assert_eq!(buf, "Thu, 1 Jan 1970 00:00:00 -0000");
1105 ```
1106
1107 But now you can just do this:
1108
1109 ```rust
1110 use jiff::{fmt::rfc2822::DateTimePrinter, Timestamp};
1111
1112 assert_eq!(
1113 DateTimePrinter::new().timestamp_to_string(&Timestamp::UNIX_EPOCH).unwrap(),
1114 "Thu, 1 Jan 1970 00:00:00 -0000",
1115 );
1116 ```
1117
1118 Enhancements:
1119
1120 * [#122](https://github.com/BurntSushi/jiff/pull/122):
1121 Support formatting `Timestamp` to an RFC 3339 string with a specific offset.
1122
1123
1124 0.1.11 (2024-08-28)
1125 ===================
1126 This release includes a few small enhancements that have been requested over
1127 the last several weeks. The biggest enhancement is a new `jiff::fmt::serde`
1128 sub-module. It provides convenience routines similar to Chrono's
1129 `chrono::serde` sub-module for serializing and deserializing between a
1130 `jiff::Timestamp` and an integer number of seconds, milliseconds, microseconds
1131 or nanoseconds. For example:
1132
1133 ```rust
1134 use jiff::Timestamp;
1135
1136 #[derive(serde::Serialize, serde::Deserialize)]
1137 struct Record {
1138 #[serde(with = "jiff::fmt::serde::timestamp::second::required")]
1139 timestamp: Timestamp,
1140 }
1141
1142 let json = r#"{"timestamp":1517644800}"#;
1143 let got: Record = serde_json::from_str(&json).unwrap();
1144 assert_eq!(got.timestamp, Timestamp::from_second(1517644800).unwrap());
1145 assert_eq!(serde_json::to_string(&got).unwrap(), json);
1146 ```
1147
1148 If you need to support optional timestamps via `Option<Timestamp>`, then use
1149 `jiff::fmt::serde::timestamp::second::optional` instead. Similarly, if you
1150 need to support milliseconds instead of seconds, then replace `second` with
1151 `millisecond` in the module path.
1152
1153 Enhancements:
1154
1155 * [#78](https://github.com/BurntSushi/jiff/issues/78):
1156 Add `BrokenDownTime::set_{offset,iana_time_zone}` APIs.
1157 * [#93](https://github.com/BurntSushi/jiff/issues/93):
1158 Add note about using `Timestamp::now().to_zoned()` instead of
1159 `Zoned::now().with_time_zone()`.
1160 * [#101](https://github.com/BurntSushi/jiff/issues/101):
1161 Add new `jiff::fmt::serde` module for integration with integer timestamps.
1162 * [#117](https://github.com/BurntSushi/jiff/pull/117):
1163 Remove `unsafe` usage in `libm` functions (applicable only to no-std users).
1164
1165
1166 0.1.10 (2024-08-23)
1167 ===================
1168 This release features a small bug fix where Jiff will detect an IANA time
1169 zone identifier in some cases where it wouldn't before. While Jiff would
1170 previously read the symlink metadata on `/etc/localtime` by default to discover
1171 the system configured time zone on Unix systems, it *wouldn't* do so when
1172 `TZ=/etc/localtime`. There's really no reason not to, so this release of Jiff
1173 is fixed to use symlink sniffing on file paths provided by the `TZ` environment
1174 variable.
1175
1176 Bug fixes:
1177
1178 * [#113](https://github.com/BurntSushi/jiff/issues/113):
1179 When `TZ=/etc/localtime`, use symlink metadata to detect IANA identifier.
1180
1181
1182 0.1.9 (2024-08-23)
1183 ==================
1184 This release introduces new options for controlling the precision
1185 of fractional seconds when printing `Zoned`, `Timestamp`,
1186 `civil::DateTime` or `civil::Time` values. This is principally exposed
1187 via `jiff::fmt::temporal::DateTimePrinter::precision`, but it's also
1188 available via the standard library's formatting machinery. For example,
1189 if `zdt` is a `jiff::Zoned`, then `format!("{zdt:.6}")` will format
1190 it into a string with microsecond precision, even if its fractional
1191 component is zero.
1192
1193 Enhancements:
1194
1195 * [#92](https://github.com/BurntSushi/jiff/issues/92):
1196 Support setting the precision of fractional seconds when printing datetimes.
1197
1198
1199 0.1.8 (2024-08-19)
1200 ==================
1201 This releases fixes a build error in Jiff's `alloc`-only configuration. This
1202 regression was introduced in `jiff 0.1.6`.
1203
1204 Bug fixes:
1205
1206 * [#108](https://github.com/BurntSushi/jiff/issues/108):
1207 Use `core::time::Duration` everywhere instead of `std::time::Duration`.
1208
1209
1210 0.1.7 (2024-08-18)
1211 ==================
1212 This release relaxes Jiff's dependency on `windows-sys` to include multiple
1213 semver incompatible releases. The purpose of this relaxation is to enable
1214 Jiff to work with different versions of `windows-sys` in the hopes that this
1215 reduces the likelihood that multiple copies of `windows-sys` are included in
1216 your dependency tree.
1217
1218 Dependencies:
1219
1220 * [#106](https://github.com/BurntSushi/jiff/pull/106):
1221 Relax `windows-sys` dependency constraint to `>=0.52.0, <=0.59.*`.
1222
1223
1224 0.1.6 (2024-08-18)
1225 ==================
1226 This release includes a new top-level type, `SignedDuration`, that provides a
1227 near exact replica of `std::time::Duration`, but signed. It is meant to provide
1228 alternative APIs for working with durations at a lower level than what `Span`
1229 provides, and to facilitate better integration with the standard library.
1230
1231 A `SignedDuration` has also been integrated with all of Jiff's datetime types.
1232 For example, previously, `Zoned::checked_add` only accepted a concrete
1233 `jiff::Span`. But now it accepts a `jiff::Span`, `jiff::SignedDuration` or even
1234 a `std::time::Duration`. Moreover, all of the `until` and `since` APIs on
1235 datetime types have been ported and copied to return `SignedDuration` under the
1236 `duration_until` and `duration_since` names.
1237
1238 This marks an initial integration phase with `SignedDuration`. It is planned
1239 to integrate it more with the datetime types. Currently, there are integrations
1240 on `Timestamp` and `Span`, but more will be added in the future.
1241
1242 Overall, folks should still use `Span`. That is the intended default duration
1243 type in Jiff and will continue to be. Users of Jiff may find `SignedDuration`
1244 useful in contexts where speed is important or when one needs to integrate
1245 with the standard library.
1246
1247 This release also includes a few related deprecations as the APIs involving
1248 `std::time::Duration` are phased out in favor of `SignedDuration`.
1249
1250 Deprecations:
1251
1252 * `Timestamp::as_duration`: replaced with `as_jiff_duration`, which will be
1253 renamed to `as_duration` in `jiff 0.2`.
1254 * `Timestamp::from_duration`: replaced with `from_jiff_duration`, which will be
1255 renamed to `from_duration` in `jiff 0.2`.
1256 * `Timestamp::from_signed_duration`: replaced with `from_jiff_duration`.
1257 * `Span::to_duration`: replaced with `to_jiff_duration`, which will be renamed
1258 to `to_duration` in `jiff 0.2`.
1259
1260 Basically, all of the above APIs either accept or return a
1261 `std::time::Duration`. To avoid breaking changes at this point, new methods
1262 for `SignedDuration` were added. For example, `Timestamp::as_jiff_duration`.
1263 In `jiff 0.2`, the above deprecated methods will be removed and replaced with
1264 equivalent methods that accept or return a `SignedDuration` instead. Callers
1265 can then convert between a `SignedDuration` and a `std::time::Duration` using
1266 appropriate `TryFrom` trait implementations.
1267
1268 Enhancements:
1269
1270 * [#21](https://github.com/BurntSushi/jiff/issues/21):
1271 Add new top-level `SignedDuration` type.
1272 * [#90](https://github.com/BurntSushi/jiff/issues/90):
1273 Improve error message when using `Span` with >=day units with a `Timestamp`.
1274
1275 Performance:
1276
1277 * [#104](https://github.com/BurntSushi/jiff/pull/104)
1278 Optimize offset calculations in time zones without DST.
1279 * [#105](https://github.com/BurntSushi/jiff/pull/105)
1280 Optimize offset calculations for timestamps after last DST rule change.
1281
1282
1283 0.1.5 (2024-08-09)
1284 ==================
1285 This release includes some improvements and bug fixes, particularly for Jiff's
1286 `strtime` APIs.
1287
1288 Enhancements:
1289
1290 * [#63](https://github.com/BurntSushi/jiff/issues/63):
1291 Add link to original Chrono maintainer's commentary in `DESIGN.md`.
1292 * [#75](https://github.com/BurntSushi/jiff/issues/75):
1293 Add support for `%V` for formatting _and_ parsing IANA time zone identifiers.
1294 * [#79](https://github.com/BurntSushi/jiff/pull/79):
1295 Add `devcontainer.json` to support GitHub Codespaces.
1296 * [#85](https://github.com/BurntSushi/jiff/pull/85):
1297 Set correct ranges for internal tracking in return value of `days_in_month`.
1298
1299 Bug fixes:
1300
1301 * [#59](https://github.com/BurntSushi/jiff/issues/59):
1302 Fixes a bug where some `Span`s could not be roundtripped through ISO 8601.
1303 * [#71](https://github.com/BurntSushi/jiff/issues/71):
1304 Tweak wording in documentation of "printf"-style API.
1305 * [#73](https://github.com/BurntSushi/jiff/issues/73):
1306 Make it so `%.Nf` only formats to `N` decimal places.
1307 * [#77](https://github.com/BurntSushi/jiff/pull/77):
1308 Disable optimizations when running tests.
1309
1310
1311 0.1.4 (2024-08-01)
1312 ==================
1313 This release includes a small improvement for `strptime` that permits
1314 `%Y%m%d` to parse `20240730` correctly.
1315
1316 Enhancements:
1317
1318 * [#62](https://github.com/BurntSushi/jiff/issues/62):
1319 Tweak `strptime` so that things like `%Y` aren't unceremoniously greedy.
1320
1321
1322 0.1.3 (2024-07-30)
1323 ==================
1324 This release features support for `wasm32-unknown-unknown`. That is, when
1325 Jiff's new `js` crate feature is enabled, Jiff will automatically use
1326 JavaScript APIs to determine the current time and time zone.
1327
1328 Enhancements:
1329
1330 * [#58](https://github.com/BurntSushi/jiff/pull/58):
1331 Add WASM support and a new `PLATFORM.md` guide.
1332
1333
1334 0.1.2 (2024-07-28)
1335 ==================
1336 This release features a few new APIs that a need for arose while experimenting
1337 with actually using Jiff in real projects. Namely, the `jiff::fmt::strtime`
1338 module now has `%f` and `%.f` directives for parsing and formatting fractional
1339 seconds. And both `jiff::fmt::rfc2822` and `jiff::fmt::strtime` now have
1340 support for skipping weekday checks during parsing. (Previously, Jiff required
1341 that an English weekday be consistent with the date parsed, and there was no
1342 way to opt out. While this is still the default behavior, callers can disable
1343 this check.)
1344
1345 Enhancements:
1346
1347 * [#52](https://github.com/BurntSushi/jiff/pull/52):
1348 Improve documentation for `Span` getter methods.
1349 * [#53](https://github.com/BurntSushi/jiff/pull/53):
1350 Add support for skipping weekday checking when parsing datetimes.
1351 * [#55](https://github.com/BurntSushi/jiff/pull/55):
1352 Add support for fractional seconds in `jiff::fmt::strtime`.
1353
1354 Bug fixes:
1355
1356 * [#49](https://github.com/BurntSushi/jiff/pull/49):
1357 Fix informational regex describing ISO 8601 format.
1358 * [#51](https://github.com/BurntSushi/jiff/pull/51):
1359 Explicitly allow new deny-by-default lint `ambiguous_negative_literals`.
1360
1361
1362 0.1.1 (2024-07-25)
1363 ==================
1364 This is a new semver compatible release. The principle addition are APIs for
1365 converting between a `jiff::Span` and a `std::time::Duration`. Specifically,
1366 there are now `TryFrom<Span> for Duration` and `TryFrom<Duration> for Span`
1367 trait implementations. There is also a `Span::to_duration`, which requires a
1368 relative date, for converting spans with non-uniform units (like months) to a
1369 `Duration`.
1370
1371 Enhancements:
1372
1373 * [#21](https://github.com/BurntSushi/jiff/issues/21),
1374 [#40](https://github.com/BurntSushi/jiff/issues/40):
1375 Adds APIs for converting between `Span` and `std::time::Duration`.
1376
1377 Bug fixes:
1378
1379 * [#36](https://github.com/BurntSushi/jiff/issues/36):
1380 Saturating arithmetic for `Timestamp` panics with day-or-greater units.
1381 * [#38](https://github.com/BurntSushi/jiff/issues/38):
1382 Fix some bugs in the micro-benchmarks.
1383 * [#39](https://github.com/BurntSushi/jiff/issues/39):
1384 Document that the RFC 2822 parser is not technically fully spec compliant.
1385
1386
1387 0.1.0 (2024-07-21)
1388 ==================
1389 The initial release of Jiff.
1390
1391 [IANA Time Zone Database]: https://www.iana.org/time-zones
1392 [PLATFORM]: PLATFORM.md
1393 [RFC 9110]: https://datatracker.ietf.org/doc/html/rfc9110#section-5.6.7-15
1394 [`jiff-icu`]: https://docs.rs/jiff-icu
1395 [`jiff-sqlx`]: https://docs.rs/jiff-sqlx
1396 [`jiff-diesel`]: https://docs.rs/jiff-diesel
1397 [ICU4X project]: https://github.com/unicode-org/icu4x
1398 [SQLx]: https://github.com/launchbadge/sqlx
1399 [Diesel]: https://github.com/diesel-rs/diesel
1400 [Discussions on GitHub]: https://github.com/BurntSushi/jiff/discussions