fix(deps): update rust crate jiff to 0.2.0 #14
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.
This PR contains the following updates:
0.1.4
->0.2.0
0.1.14
->0.2.0
Release Notes
BurntSushi/jiff (jiff)
v0.2.14
Compare Source
===================
This release includes a smattering of bug fixes, and hopefully a small
improvement to the time it takes to compile Jiff. Also, in this release, when
TZ
is set to a non-empty but invalid value, Jiff will always fall back toEtc/Unknown
when usingTimeZone::system()
. This differs from previousbehavior where Jiff would, in this case, attempt to read the system's default
time zone. This change brings Jiff into consistency with existing Unix tooling
like
date
, and is also arguably a better failure mode. That is, whenTZ
isset but invalid, we shouldn't silently fall back to the default system time
zone, but instead do something that indicates something has potentially gone
wrong.
Enhancements:
Jiff now falls back to
Etc/Unknown
for invalidTZ
values.Improve compilation times.
Bug fixes:
Fixes a compile error in Jiff when only the
tzdb-concatenated
feature wasenabled.
Fixes slow initial
Zoned::now()
in environments where/usr/share/zoneinfo
is on a very slow file system (like CI environments).
Avoids searching for a tzdb at
/usr/share/zoneinfo
on Windows.v0.2.13
Compare Source
===================
This release fixes a bug in a corner case where
TimeZone::following
couldsometimes omit the last time zone transition. This could only happen in time
zones that once had daylight saving time, but ended it. This did not have an
impact on other Jiff APIs that handle daylight saving time.
Bug fixes:
Fix a bug where
TimeZone::following
could omit the last historical time zonetransition.
v0.2.12
Compare Source
===================
This release fixes a couple bugs in Jiff's parser. In particular, a regression
was introduced in
jiff 0.2.11
where its RFC 2822 parser could panic on someinputs. Previous releases of Jiff are unaffected.
Bug fixes:
Fix a bug where parsing
1970-06-01T00-00:45:00[Africa/Monrovia]
succeededbut it should fail.
Fix a bug where the RFC 2822 parser could panic on some inputs.
v0.2.11
Compare Source
===================
This release includes new APIs for customizing Jiff's
strtime
behavior alongwith a few minor bug fixes. Jiff's
strtime
formatting API has also beenoptimized. It's about twice as fast as it was.
This release also coincides with the publication of
jiff-icu 0.2.0-beta.2
,which has support for
icu 2.0.0-beta.2
.Enhancements:
Add support for the
%c
,%r
,%X
and%x
conversion specifiers.Add support for
%q
injiff::fmt::strtime
(prints quarter of year).Add support for
%::z
and%:::z
injiff::fmt::strtime
.Add support for
%N
injiff::fmt::strtime
(alias for%9f
).Add a "lenient" mode for
strtime
formatting APIs that ignores most errors.Bug fixes:
Document default precision behavior of
Display
impls for datetime types.Allow whitespace in more places in RFC 2822 parser (improves spec compliance).
TimeZone::get("UTC")
should now always returnTimeZone::UTC
.Performance:
Jiff's
strftime
APIs are now approximately twice as fast as they were.Performance should be comparable to
chrono
andtime
's prebuilt APIs.v0.2.10
Compare Source
===================
This release includes a bug fix for parsing
Tuesday
when using%A
viaJiff's
strptime
APIs. Specifically, it would recognizeTueday
instead ofTuesday
.Bug fixes:
Fix typo in
strptime
parsing fromTueday
toTuesday
.v0.2.9
Compare Source
==================
This release includes a bug fix that, in debug mode, could result in datetime
types having different hashes for the same value. This could cause problems,
for example, if you are using datetimes as keys in a hash map. This problem
didn't exist when Jiff was compiled in release mode.
This release also improves the panic message shown when the
js
feature isn'tenabled and the current time is requested on
wasm32-unknown-unknown
targets.Enhancements:
Provide a better panic message when
Zoned::now()
fails on WASM.Bug fixes:
Fix bug where
Hash
on datetime types could yield different hash values forthe same underlying date/time.
v0.2.8
Compare Source
==================
This release fixes a bug where the constructors on
SignedDuration
for floating point durations could panic (in debug mode) or produce
incorrect results (in release mode). This bug only impacts users of
the
try_from_secs_{f32,f64}
andfrom_secs_{f32,f64}
methods onSignedDuration
.Enhancements:
Add an alternate
Debug
impl forSignedDuration
that only shows its secondand nanosecond components (while using only one component when the other is
zero).
Bug fixes:
Fix a bug that could produce a panic or incorrect results in
SignedDuration::(try_)?from_secs_{f32,f64}
.v0.2.7
Compare Source
==================
This release includes a bug fix that changes how an empty but set
TZ
environment variable is interpreted (as indistinguishable from
TZ=UTC
).This also includes a new enabled by default create feature,
perf-inline
,which allows toggling Jiff's use of
inline(always)
. This may help improvecompile times or decrease binary size.
Enhancements:
Remove some internal uses of generics to mildly improve compile times.
Add
perf-inline
crate feature for controllinginline(always)
annotations.Bug fixes:
Make
TZ=
indistinguishable fromTZ=UTC
.v0.2.6
Compare Source
==================
This release includes a few bug fixes and support for discovering the IANA Time
Zone Database automatically on Illumos.
Enhancements:
Add support for automatically finding the tzdb on Illumos.
Bug fixes:
Fixed
Zoned
rounding on days with DST time zone transitions.Fixed bug where
TimeZone::preceding
could omit historical time zonetransitions for time zones that have eliminated DST in the present.
Fixed
nth_weekday_in_month
, where it would sometimes incorrectly return anerror.
v0.2.5
Compare Source
==================
This release updates Jiff's bundled copy of the [IANA Time Zone Database] to
2025b
. See the [2025b
release announcement][2025b release announcement] for more details.Enhancements:
Update
jiff-tzdb
to2025b
.v0.2.4
Compare Source
==================
This is another small release that fixes a problem where Jiff could break
builds if they relied on inference for integer comparisons. Specifically, Jiff
uses internal trait impls to make comparing its internal ranged integers
more convenient. But Rust the language has no concept of "internal" trait
impls, and thus this can impact type inference. If code was written in a way
that relies on a singular trait impl that is available, then adding Jiff to
the project can cause it to break.
This isn't arguably Jiff's fault per se, but since these trait impls were just
about internal convenience and not essential to Jiff's design, we adopt a
pragmatic approach and just remove them.
Bug fixes:
Remove internal trait impls that can cause breaks due to inference failures.
v0.2.3
Compare Source
==================
This is a small release that fixes a bug in the handling of POSIX time zones
in some cases. Specifically, the implementation of
Date::yesterday
was wrongwhen the date was the first of the month. This was a regression introduced in
0.2.2
and was not present in older releases. More test coverage has beenadded.
Bug fixes:
Fix bug in implementation of
Date::yesterday
.v0.2.2
Compare Source
==================
This release of Jiff includes a new opt-in proc macro for embedding a
TimeZone
into your binary. Just enable Jiff'sstatic
feature, and this willprint the current time in the
America/New_York
time zone:This enables
TimeZone
to be meaningfully used in core-only environments,even when dynamic memory allocation isn't available.
This release also features a number of performance improvements for time zone
lookups. In some cases, the improvement is significant (by an order of
magnitude).
Additionally, the IANA Time Zone Database embedded into
jiff-tzdb
nowuses "rearguard" semantics. This means that the boolean flag indicating
whether daylight saving time is active or not (only accessible via
TimeZone::to_offset_info
) will respect the actual definition ofdaylight saving time. (This is relevant, for example, for time zones like
Europe/Dublin
, where their summer time is legally known as their standardtime, but is in effect daylight saving time.)
Enhancements:
Add
tz::{get,include}
macros for time zone support in core-only environments.Switch to
rearguard
tzdb data injiff-tzdb
and document it.De-duplicate TZif data in
jiff-tzdb
.Add "crate features" documentation to
jiff-sqlx
andjiff-diesel
.Document semver guarantee for error conditions on
Timestamp
constructors.Greatly optimize time zone lookups (for both timestamps and civil datetimes).
Bug fixes:
Improve the documentation for
ZonedWith::nanosecond
andZonedWith::subsec_nanosecond
.v0.2.1
Compare Source
===================
This release includes a smattering of bug fixes, and hopefully a small
improvement to the time it takes to compile Jiff. Also, in this release, when
TZ
is set to a non-empty but invalid value, Jiff will always fall back toEtc/Unknown
when usingTimeZone::system()
. This differs from previousbehavior where Jiff would, in this case, attempt to read the system's default
time zone. This change brings Jiff into consistency with existing Unix tooling
like
date
, and is also arguably a better failure mode. That is, whenTZ
isset but invalid, we shouldn't silently fall back to the default system time
zone, but instead do something that indicates something has potentially gone
wrong.
Enhancements:
Jiff now falls back to
Etc/Unknown
for invalidTZ
values.Improve compilation times.
Bug fixes:
Fixes a compile error in Jiff when only the
tzdb-concatenated
feature wasenabled.
Fixes slow initial
Zoned::now()
in environments where/usr/share/zoneinfo
is on a very slow file system (like CI environments).
Avoids searching for a tzdb at
/usr/share/zoneinfo
on Windows.v0.2.0
Compare Source
==================
This is a new semver incompatible release of Jiff. It contains several breaking
changes. I expect most users of Jiff to be able to upgrade without any changes.
The fundamental API organization of Jiff has not changed.
Some of the highlights of this release include reducing footguns and better
ecosystem integration.
For reducing footguns, APIs on
Span
will no longer implicitly assume thatdays are always 24 hours long. And
Span
no longer implementsPartialEq
orEq
(instead favoringspan.fieldwise()
to create a value that supports naivefieldwise comparison). Moreover, when using
TimeZone::system()
(perhaps viaZoned::now()
), if the system time zone could not be detected, then a specialEtc/Unknown
time zone will be used instead. This avoids erroring, but alsosurfaces itself to make it clearer that something has (perhaps) gone wrong.
As for ecosystem integration, this release coincides with the publication
of the [
jiff-icu
], [jiff-sqlx
] and [jiff-diesel
] crates.jiff-icu
integrates with the [ICU4X project], and is now the recommended way to use
Jiff to work with non-Gregorian calendars or to localize datetimes for end
users.
jiff-sqlx
andjiff-diesel
provide wrapper types that implement thenecessary traits to make it ergonomic to store and retrieve Jiff values in a
database using [SQLx] or [Diesel], respectively.
Unless something unexpected happens, my plan is for the next breaking change
release to be Jiff 1.0 in about 6 months. Once Jiff 1.0 is out, I plan to
commit to it indefinitely.
BREAKING CHANGES:
This is an exhaustive list of breaking changes. Changes with the bolded
RUNTIME prefix are changes that will not be caught by the Rust compiler.
That is, they are changes in runtime behavior.
The deprecated
intz
routines onZoned
,Timestamp
,civil::DateTime
andcivil::Date
have been removed. You can usein_tz
instead. This change wasmade because many found the name
intz
to be unclear.The
PartialEq
andEq
trait implementations onSpan
have been removed.Ideally these shouldn't have been used, but if you do need them, please use
Span::fieldwise
to create aSpanFieldwise
, which does have thePartialEq
and
Eq
traits implemented. These were removed onSpan
itself because theymade it very easy to commit subtle bugs.
Turn panics during
Timestamp::saturing_add
into errors. Callers addingspans that are known to contain units of hours or smaller are guaranteed that
this will not return an error.
On
Span
APIs, days are no longer silently assumed to always be 24 hours whena relative datetime is not provided. Instead, to perform operations on units
of days or bigger, callers must either provide a relative date or opt into
invariant 24-hour days with
SpanRelativeTo::days_are_24_hours
. Shortcuts havebeen added to the span builders. For example,
SpanTotal::days_are_24_hours
.Change the behavior of the deprecated
%V
conversion specifier injiff::fmt::strtime
from formatting an IANA time zone identifier to formattingan ISO 8601 week number. To format an IANA time zone identifier, use
%Q
or%:Q
(which were introduced injiff 0.1
).When parsing into a
Zoned
with a civil time corresponding to a gap, we treatall offsets as invalid and return an error. Previously, we would accept the
offset as given. This brings us into line with Temporal's behavior. For
example, previously Jiff accepted
2006-04-02T02:30-05[America/Indiana/Vevay]
but will now return an error. This is desirable for cases where a datetime in
the future is serialized before a change in the daylight saving time rules.
For more examples, see
jiff::fmt::temporal::DateTimeParser::offset_conflict
for details on how to change Jiff's default behavior. This behavior change also
applies to
tz::OffsetConflict::PreferOffset
.Tweak the semantics of
tz::TimeZoneDatabase
so that it only initializes oneinternal tzdb instead of trying to find as many as possible. It is unlikely
that you'll be impacted by this change, but it's meant to make the semantics
be a bit more sensible. (In
jiff 0.1
, it was in theory possible for one tzlookup to succeed in the system zoneinfo and then another tz lookup to fail
in zoneinfo but succeed automatically via the bundled copy. But this seems
confusing and possibly not desirable. Hence the change.)
In order to make naming a little more consistent between
Zoned
and
civil::Date
, thecivil::Date::to_iso_week_date
andcivil::ISOWeekDate::to_date
APIs were renamed tocivil::Date::iso_week_date
and
civil::ISOWeekDate::date
.Remove
Span::to_duration
for converting aSpan
to astd::time::Duration
and rename
Span::to_jiff_duration
toSpan::to_duration
. This prioritizesSignedDuration
as the "primary" non-calendar duration type in Jiff. And makesit more consistent with APIs like
Zoned::duration_since
. For non-calendarspans, the
TryFrom<Span> for std::time::Duration
still exists. For calendardurations, use
Span::to_duration
and then convert theSignedDuration
tostd::time::Duration
. Additionally,Timestamp::from_jiff_duration
andTimestamp::as_jiff_duration
were renamed toTimestamp::from_duration
andTimestamp::as_duration
, respectively. The old deprecated routines on theunsigned
std::time::Duration
have been removed.Change the type of the value yielded by the
jiff::tz::TimeZoneNameIter
iterator from
String
tojiff::tz::TimeZoneName
. This opaque type is moreAPI evolution friendly. To access the string, either use
TimeZoneName
'sDisplay
trait implementation, or itsas_str
method.Split
TimeZone::to_offset
into two methods. One that just returns theoffset, and another,
TimeZone::to_offset_info
, which includes the offset,DST status and time zone abbreviation. The extra info is rarely needed and
is sometimes more costly to compute. Also, make the lifetime of the time
zone abbreviation returned by
TimeZoneTransition::abbreviation
tied tothe transition instead of the time zone (for future API flexibility, likely
in core-only environments). This change was overall motivated by wanting to
do less work in the common case (where we only need the offset), and for
reducing the size of a
TimeZone
considerably in core-only environments.Callers previously using
TimeZone::to_offset
to get DST status and time zoneabbreviation should now use
TimeZone::to_offset_info
.When
TimeZone::system()
cannot find a system configured time zone,jiff 0.1
would automatically fall back toTimeZone::UTC
(with a WARN-level logmessage). In
jiff 0.2
, the fall back is now toTimeZone::unknown()
, whichhas a special
Etc/Unknown
identifier (as specified by Unicode and reserved bythe IANA time zone database). The fallback otherwise still behaves as if it
were
TimeZone::UTC
. This helps surface error conditions related to findingthe system time zone without causing unrecoverable failure.
Enhancements:
When the special
SpanRelativeTo::days_are_24_hours()
marker is used, weekswill also be treated as invariant. That is, seven 24-hour days. In all cases,
working with years and months still requires a relative date.
It is now possible to forcefully use a bundled copy of the IANA time zone
database without relying on disabling crate features. This can be done by
enabling the
tzdb-bundle-always
crate feature and explicitly creating ajiff::tz::TimeZoneDatabase::bundled()
database. Once in hand, you must useAPIs like
TimeZoneDatabase::get
to create aTimeZone
and avoid any APIsthat implicitly use the global time zone database (like
Timestamp::in_tz
oreven
Zoned::from_str
).Add integration with the ICU4X project via the [
jiff-icu
] crate.jiff-icu
provides traits for easily converting between datetime types defined in Jiff
and datetime types defined in ICU4X.
Add integration with the SQLx project via the [
jiff-sqlx
] crate.jiff-sqlx
provides wrapper types that implement the necessary traits in SQLx for
reasonably ergonomic integration. This includes PostgreSQL and SQLite support,
but not MySQL support. (It's not clear if it's possible at present to provide
MySQL supprot fro SQLx for datetime types outside of SQLx itself.)
Add integration with the Diesel project via the [
jiff-diesel
] crate.jiff-diesel
provides wrapper types that implement the necessary traits inDiesel for reasonably ergonomic integration. This includes MySQL, PostgreSQL
and SQLite support.
v0.1.29
Compare Source
===================
This release includes a few small enhancements and a bug fix. In particular,
there is now Serde support for
TimeZone
and theISOWeekDate
API has beenfilled out a bit more.
Unless a serious issue is uncovered, my plan is that this will be the last
release before
jiff 0.2
.Enhancements:
Opt-in support for using Serde with
jiff::tz::TimeZone
has been added.The
civil::ISOWeekDate
API has been beefed up with a few convenience methods.Add
tz::Offset::round
for rounding time zone offsets.Bug fixes:
Use more flexible offset equality when parsing offsets with fractional minutes.
v0.1.28
Compare Source
===================
This is a small release that just removes the dev-dependency on
serde_yml
.It has been replaced with the deprecated
serde_yaml
. Seethis post about
serde_yml
shenanigansfor why this was done. Note that this was only a dev-dependency and thus doesn't
impact folks using Jiff.
Bug fixes:
Remove dependency on
serde_yml
in favor ofserde_yaml
.v0.1.27
Compare Source
===================
This is a small release with a bug fix for precision loss in some cases when
doing arithmetic on
Timestamp
orZoned
.Bug fixes:
Fix the check for fractional seconds before taking the fast path.
v0.1.26
Compare Source
===================
This is a small release with another deprecation and a new API for doing
prefix parsing via
strptime
. There's also a bug fix for a corner casewhen dealing with daylight saving time gaps with the
Zoned::with
API.Deprecations:
Deprecate
ISOWeekDate::to_date
in favor ofISOWeekDate::date
.Enhancements:
Add
fmt::strtime::BrokenDownTime::parse_prefix
for parsing only a prefix.Bug fixes:
Fix unintuitive behavior of
Zoned::with
when time falls in a DST gap.v0.1.25
Compare Source
===================
This release contains a number of deprecations in preparation for a
jiff 0.2
release. The deprecations are meant to facilitate a smoother transition. The
deprecations, when possible, come with new APIs that will permit users to write
forward compatible code that will work in both
jiff 0.1
andjiff 0.2
.This release also includes a handful of new conversion specifiers in Jiff's
strftime
andstrptime
APIs. This improves compatibility with the analogousimplementation with GNU libc.
Deprecations:
The
intz
methods onZoned
,Timestamp
,civil::DateTime
andcivil::Date
have been deprecated in favor of
in_tz
.The
Eq
andPartialEq
trait implementations onSpan
have been deprecatedin favor of using the new
SpanFieldwise
type.Silently assuming days are always 24 hours in some
Span
APIs has now beendeprecated. This will become an error in
jiff 0.2
. To continue assumingdays are 24 hours without a relative reference date, you can use the new
SpanRelativeTo::days_are_24_hours
API. Injiff 0.1
, you'll seen aWARN-level log message emitted if you're code will be broken by
jiff 0.2
.Both
%V
and%:V
have been deprecated in favor of%Q
and%:Q
. Injiff 0.2
,%V
will correspond to the ISO 8601 week number and%:V
willresult in an error. This change was made to improve compatibility with other
strtime
implementations.%V
and%:V
continue to correspond to IANAtime zone identifiers in
jiff 0.1
, but using them for parsing or formattingwill result in a WARN-level deprecation message.
Enhancements:
Adds a number of new conversion specifiers to Jiff's
strftime
andstrptime
APIs. Specifically,%C
,%G
,%g
,%j
,%k
,%l
,%n
,%R
,%s
,%t
,%U
,%u
,%W
,%w
. Their behavior should match thecorresponding specifiers in GNU libc.
v0.1.24
Compare Source
===================
This release updates Jiff's bundled copy of the [IANA Time Zone Database] to
2025a
. See the [2025a
release announcement][2025a release announcement] for more details.Enhancements:
Update
jiff-tzdb
to2025a
.v0.1.23
Compare Source
===================
This release includes some bug fixes, particularly for compilation on
aarch64-linux-android
. There are also some minor enhancements, such as makingZoned::iso_week_date
a convenience function forcivil::Date::iso_week_date
,in line with similar functions.
My current plan is to make a reasonably quick transition to
jiff 0.2
with afew pending breaking changes. I will be making some
jiff 0.1
releases withdeprecations in order to make the transition as smooth as possible. If all goes
well with
jiff 0.2
, then my plan is still to do a Jiff 1.0 release in theSummer of 2025.
Deprecations:
Date::to_iso_week_date
has been deprecated in favor ofDate::iso_week_date
.Enhancements:
Improve ISO week date documentation regarding weekday offsets.
Add
Zoned::iso_week_date
,DateTime::iso_week_date
andDate::iso_week_date
.Bug fixes:
Fix compilation failure on Android in a Termux shell.
Re-add license files to crate artifact.
v0.1.22
Compare Source
===================
This release adds support for Android. This support means that Jiff will
automatically read its special concatenated time zone database, and will
read the
persist.sys.timezone
property to determine the system's currenttime zone.
See [PLATFORM] for more specific information about Android support.
Note that this release also removed all non-essential files (including tests
and test data) for the artifact uploaded to crates.io. If you need or want
these files, please open a new issue.
Enhancements:
Add support for the Android platform.
v0.1.21
Compare Source
===================
This release includes a new API for setting the unit designator label in a
friendly formatted duration for zero-length durations.
Enhancements:
Add option to the friendly printer for setting the unit when writing a
zero-length duration.
v0.1.20
Compare Source
===================
This release inclues a new type,
Pieces
, in thejiff::fmt::temporal
sub-module. This exposes the individual components of a parsed Temporal
ISO 8601 datetime string. It allows users of Jiff to circumvent the checks
in the higher level parsing routines that prevent you from shooting yourself
in the foot.
For example, parsing into a
Zoned
will return an error for raw RFC 3339timestamps like
2025-01-03T22:03-05
because there is no time zone annotation.Without a time zone, Jiff cannot do time zone aware arithmetic and rounding.
Instead, such a datetime can only be parsed into a
Timestamp
. This lowerlevel
Pieces
API now permits users of Jiff to parse this string into itscomponent parts and assemble it into a
Zoned
if they so choose.Enhancements:
Add
fmt::temporal::Pieces
for granular datetime parsing and formatting.v0.1.19
Compare Source
===================
This releases includes a UTF-8 related bug fix and a few enhancements.
Firstly, a
Span
's defaultDisplay
implementation now writes uppercaseunit designator labels. That means you'll get
P1Y2M3DT4H5M6S
insteadof
P1y2m3dT4h5m6s
by default. You can restore previous behavior viajiff::fmt::temporal::SpanPrinter::lowercase
. This change was made to improveinteroperability.
Secondly,
SignedDuration
now supports rounding viaSignedDuration::round
.Note that it only supports rounding time units (hours or smaller). In order to
round with calendar units, you'll still need to use a
Span
.Enhancements:
Document value ranges for methods like
year
,day
,hour
and so on.Add a rounding API (for time units only) on
SignedDuration
.Span
andSignedDuration
now use uppercase unit designator labels in theirdefault ISO 8601
Display
implementation.Bug fixes:
Relax
strftime
format strings from ASCII-only to all of UTF-8.v0.1.18
Compare Source
===================
This release includes a few minor enhancements. Namely, the ability to iterate
over time zone transitions (in the future or the past), and some improvements
to failure modes when
Timestamp
andSpan
arithmetic fails.Enhancements:
Add APIs for iterating over the transitions of a time zone.
Improve docs and error messages around fallible
Timestamp
arithmetic.v0.1.17
Compare Source
===================
This release enhances Jiff's support for
no_std
environments by making itsalloc
feature optional. Whenalloc
is disabled, only fixed offset timezones are supported and error messages are significantly degraded. If you have
core-only use cases for Jiff, I'd love to hear about them on the issue tracker.
Enhancements:
Support platforms that do not have atomics in
std
.Jiff now supports disabling the
alloc
feature, which enables core-only mode.Add
TimeZone::to_fixed_offset
for accessing an invariant offset if possible.v0.1.16
Compare Source
===================
This release includes a new
jiff::fmt::friendly
module for formatting andparsing durations in a more human readable format than what ISO 8601 specifies.
ISO 8601 remains the "default" duration format in Jiff due to its widespread
support. Here are some examples:
To quickly demonstrate this new feature, here's a simple CLI program using
Clap:
And running the program:
With Jiff, you should no longer need to pull in crates like
humantime
andhumantime-serde
to accomplish a similar task.
While this new format doesn't support any kind of internationalization, the
prevalence of the
humantime
crate suggests there's a desire for somethinglike this. The "friendly" format is meant to service all the same use cases
as
humantime
does for durations, but in a way that doesn't let you shootyourself in the foot.
The new "friendly" format is now the default for the
Debug
implementationsof both
Span
andSignedDuration
. It's also available via the "alternate"Display
implementations forSpan
andSignedDuration
as well. Moreover,the
FromStr
trait implementations for bothSpan
andSignedDuration
willparse both the ISO 8601 duration and this new "friendly" format. Finally,
when
serde
integration is enabled, theDeserialize
implementations forSignedDuration
andSpan
also automatically parse either ISO 8601 or thefriendly format. For serialization, ISO 8601 remains the default, but the
jiff::fmt::serde
module provides easy to use helpers to switch to thefriendly format.
The
jiff::fmt::friendly
module documentation provides many more details,including a complete grammar for the format.
Enhancements:
Add
Hash
implementation forZoned
andTimestamp
.Bug fixes:
Use a better
Debug
output format forSignedDuration
andSpan
.Add a new "friendly" duration format.
Fix deserialization in
serde_yml
andserde_yaml
crates.Fix
serde
dependency configuration so that it builds in no-std mode.v0.1.15
Compare Source
===================
This release fixes a bug where Jiff would sometimes fail to parse TZif files
(found, typically, in
/usr/share/zoneinfo
on Unix systems). This occurredwhen the TZif file contained a time zone transition outside the range of Jiff's
Timestamp
type (which is-9999-01-01
to9999-12-31
). The bug fix works byclamping the out-of-range transitions to Jiff's supported range.
This bug only seems to occur in some environments where their TZif files
contain more extreme values than what is typically found.
Bug fixes:
Fix a bug where Jiff would fail to parse some TZif files.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.