NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io, #105 most downloaded on crates.io
Date and time library for Rust
Latest stable
0.4.45
Last release 5 months ago
04 Jun 2026
Release timing varies
gaps range from 3 weeks to 8 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
22 versions withdrawn
withdrawn after publishing
12 years old
95 releases · first in 2014
Drag across the ruler to compare, or tap a release to open it.
fix(tz): reject TZ offset hour of 24 to avoid FixedOffset overflow by @SAY-5 in #1787
Add track_caller to non-deprecated functions by @svix-jplatte in #1774
Cargo.toml contents by @coryan in #1772Your coding agent can read these notes before it upgrades. Set up the MCP server →
Cargo.toml contents by @coryan in https://github.com/chronotope/chrono/pull/1772Install extra components for lint workflow by @djc in #1741
NaiveDate::abs_diff by @Kinrany in #1752NaiveDate::abs_diff by @Kinrany in https://github.com/chronotope/chrono/pull/1752Add fuzzer for DateTime::parse_from_str by @tyler92 in #1700
wasm32-linux support by @arjunr2 in #1707tzdata parsing by @ldm0 in #1679?Sized bound to related methods of DelayedFormat::write_to by @Huliiiiii in #1721from_timestamp_secs method to DateTime by @jasonaowen in #1719wasm32-linux support by @arjunr2 in https://github.com/chronotope/chrono/pull/1707tzdata parsing by @ldm0 in https://github.com/chronotope/chrono/pull/1679?Sized bound to related methods of DelayedFormat::write_to by @Huliiiiii in https://github.com/chronotope/chrono/pull/1721from_timestamp_secs method to DateTime by @jasonaowen in https://github.com/chronotope/chrono/pull/1719Deprecate NaiveDateTime::UNIX_EPOCH by @robertbastian in #1670
subsec_micros and subsec_millis methods to TimeDelta by @ggoetz in #1668NaiveDateTime::UNIX_EPOCH by @robertbastian in #1670as_seconds_f32 and as_seconds_f64 for TimeDelta by @ggoetz in #1671num_days_in_month method to Datelike trait by @aslilac in #1673WeekdaySet, a collection of Weekday that is Copy by @Kinrany in #1676Add Month::num_days() by @djc in #1645
write_to for DelayedFormat by @tugtugtug in #1654write_to for DelayedFormat by @tugtugtug in https://github.com/chronotope/chrono/pull/1654Remove obsolete weird feature guard by @djc in #1582
from_timestamp_nanos() by @sgoll in #1591NaiveWeek methods by @bragov4ik in #1600PartialEq,Eq,Hash,Copy and Clone on NaiveWeek by @DSeeLP in #1618#[inline] to num_days by @CommanderStorm in #1627from_timestamp_nanos() by @sgoll in https://github.com/chronotope/chrono/pull/1591NaiveWeek methods by @bragov4ik in https://github.com/chronotope/chrono/pull/1600PartialEq,Eq,Hash,Copy and Clone on NaiveWeek by @DSeeLP in https://github.com/chronotope/chrono/pull/1618#[inline] to num_days by @CommanderStorm in https://github.com/chronotope/chrono/pull/1627In chrono 0.4.36 we made an accidental breaking change by switching to derive(Copy) for DateTime instead of a manual implementation. It is reverted in…
This release bring a ca. 20% improvement to the performance of the formatting code, and a convenient days_since method for the Weekday type.
Chrono 0.4.38 also removes the long deprecated rustc-serialize feature. Support for rustc-serialize will be soft-destabilized in the next Rust edition. Removing the feature will not break existing users of the feature; Cargo will just not update dependents that rely on it to newer versions of chrono.
In chrono 0.4.36 we made an accidental breaking change by switching to derive(Copy) for DateTime instead of a manual implementation. It is reverted in this release.
rustc-serialize feature (#1548, thanks @workingjubilee)Weekday::days_since (#1249, based on #216 by @clarfonthey)TimeDelta::checked_mul and TimeDelta::checked_div (#1565, thanks @Zomtir)Copy for DateTime if offset is Copy (#1573)test_encodable_json and test_decodable_json functions (#1550)cargo hack check (#1553)Thanks to all contributors on behalf of the chrono team, @djc and @pitdicker!
Version 0.4.36 introduced an unexpected breaking change and was yanked. In it LocalResult was renamed to MappedLocalTime to avoid the impression that…
Version 0.4.36 introduced an unexpected breaking change and was yanked. In it LocalResult was renamed to MappedLocalTime to avoid the impression that it is a Result type were some of the results are errors. For backwards compatibility a type alias with the old name was added.
As it turns out there is one case where a type alias behaves differently from the regular enum: you can't import enum variants from a type alias with use chrono::LocalResult::*. With 0.4.37 we make the new name MappedLocalTime the alias, but keep using it in function signatures and the documentation as much as possible.
See also the release notes of chrono 0.4.36 from yesterday for the yanked release.
This release un-deprecates the methods on TimeDelta that were deprecated with the 0.4.35 release because of the churn they are causing for the ecosyst…
This release un-deprecates the methods on TimeDelta that were deprecated with the 0.4.35 release because of the churn they are causing for the ecosystem.
New is the DateTime::with_time() method. As an example of when it is useful:
use chrono::{Local, NaiveTime};
// Today at 12:00:00
let today_noon = Local::now().with_time(NaiveTime::from_hms_opt(12, 0, 0).unwrap());
DateTime::with_time() (#1510)TimeDelta deprecations (#1543)TimeStamp::timestamp_subsec_nanos, which was missed in the 0.4.35 release (#1486)Copy and Send impls (#1492, thanks @erickt)NaiveDate unit tests (#1500, thanks @Zomtir)LocalResult to TzResolution, add alias (#1501)NaiveDate::from_yof (#1518)DateTime::date_naive and NaiveDate::diff_months (#1530)unwrap in Unix Local type (#1533)Thanks to all contributors on behalf of the chrono team, @djc and @pitdicker!
This will allow us to improve our formatting and parsing support, and we have reason to believe this breaking change will have little to no impact on…
Most of our efforts have shifted to improving the API for a 0.5 release, for which cleanups and refactorings are landing on the 0.4.x branch.
The most significant changes in this release are two sets of deprecations.
We deprecated all timestamp-related methods on NaiveDateTime. The reason is that a timestamp is defined to be in UTC. The NaiveDateTime type doesn't know the offset from UTC, so it was technically wrong to have these methods. The alternative is to use the similar methods on the DateTime<Utc> type, or from the TimeZone trait.
Converting from NaiveDateTime to DateTime<Utc> is simple with .and_utc(), and in the other direction with .naive_utc().
The panicking constructors of TimeDelta (the new name of the Duration type) are deprecated. This was the last part of chrono that defaulted to panicking on error, dating from before rust 1.0.
A nice change is that NaiveDate now includes a niche. So now Option<NaiveDate>, Option<NaiveDateTime> and Option<DateTime<Tz>> are the same size as their base types.
format::Numeric and format::Fixed are marked as non_exhaustive. This will allow us to improve our formatting and parsing support, and we have reason to believe this breaking change will have little to no impact on users.
DateTime::{from_timestamp_micros, from_timestamp_nanos} (#1234)Parsed (#1465)NaiveDateTime (#1473)TimeDelta (#1450)NonZeroI32 inside NaiveDate (#1207)format::Numeric and format::Fixed as non_exhaustive (#1430)Parsed fixes to error values (#1439)overflowing_naive_local in DateTime::checked_add* (#1333)Parsed::set_* (#1465)Parsed (#1439)internals module (#1428, #1429, #1431, #1432, #1433, #1438)x86_64-unknown-illumos instead of Solaris (#1437)cargo hack check on Linux (#1442)parse_internal (#1459)SerdeError (#1458)NaiveDate::from_isoywd a bit (#1464)Thanks to all contributors on behalf of the chrono team, @djc and @pitdicker!
Don't mention some deprecated methods in docs
Duration type to TimeDelta. This removes the confusion between chrono's type and the later Duration type in the standard library. It will remain available under the old name as a type alias for compatibility.Local is rewritten. The new version avoids panics when the date is outside of the range supported by windows (the years 1601 to 30828), and gives more accurate results during DST transitions.Display format of TimeDelta is modified to conform better to ISO 8601. Previously it converted all values greater than 24 hours to a value with days. This is not correct, as doing so changes the duration from an 'accurate' to a 'nominal' representation to use ISO 8601 terms.TimeDelta::milliseconds (#1385, thanks @danwilliams)DurationExceedsTimestamp in DurationRound (#1403, thanks @joroKr21)%X (https://github.com/chronotope/pure-rust-locales/pull/12, #1420)GetTimeZoneInformationForYear (#1017)TimeDelta::try_milliseconds (#1385, thanks @danwilliams)TimeDelta::new (#1337)StrftimeItems::{parse, parse_to_owned} and more documentation (#1184)format::Locale (via https://github.com/chronotope/pure-rust-locales/pull/8)Duration to TimeDelta, add type alias (#1406)TimeDelta methods const (#1337)NaiveDate, NaiveWeek, NaiveTime and NaiveDateTime const where possible (#1337)DateTime const where possible (#1400)Display format of TimeDelta conform better to ISO 8601 (#1328)timestamp_micros's Example doc (#1338 via #1386, thanks @emikitas)TimeDelta constructors (#1385, thanks @danwilliams)main branch, work on 0.5 happens in the 0.5.x branch (#1390, #1402).impl Arbitrary for DateTime and set up CI test (#1336)codecov/codecov-action from 3 to 4 (#1404)-0000 offset (#1411)TOO_LONG error out of parse_internal (#1419)Thanks to all contributors on behalf of the chrono team, @djc and @pitdicker!
This release fixes the broken docrs.rs build of chrono 0.4.32.
This release fixes the broken docrs.rs build of chrono 0.4.32.
rkyv feature imply size_32 (#1383)Duration::hours() exception (#1384, thanks @danwilliams)Deprecate standalone format functions
In this release we shipped part of the effort to reduce the number of methods that could unexpectedly panic, notably for the DateTime and Duration types.
Chrono internally stores the value of a DateTime in UTC, and transparently converts it to the local value as required. For example adding a second to a DateTime needs to be done in UTC to get the correct result, but adding a day needs to be done in local time to be correct. What happens when the value is near the edge of the representable range, and the implicit conversions pushes it beyond the representable range? Many methods could panic on such inputs, including formatting the value for Debug output.
In chrono 0.4.32 the range of NaiveDate, NaiveDateTime and DateTime is made slightly smaller. This allows us to always do the implicit conversion, and in many cases return the expected result. Specifically the range is now from January 1, -262144 until December 31, 262143, one year less on both sides than before. We expect this may trip up tests if you hardcoded the MIN and MAX dates.
Duration had a similar issue. The range of this type was pretty arbitrary picked to match the range of an i64 in milliseconds. Negating an i64::MIN pushes a value out of range, and in the same way negating Duration::MIN could push it out of our defined range and cause a panic. This turns out to be somewhat common and hidden behind many layers of abstraction. We adjusted the type to have a minimum value of -Duration::MAX instead and prevent the panic case.
Other highlights:
Duration gained new fallible initialization methods.rkyv.NaiveDateTime are now const.DateTime const in a future release.Complete list of changes:
TimeZone::from_local_datetime (#1071)DateTime getters and setters (#1317, #1329)NaiveDateTime::checked_(add|sub)_offset (#1313)DateTime::to_utc (#1325)Default for Duration (#1327)Duration::subsec_nanos (#1327)try_* builders to Duration (#1327)AddAssign and SubAssign for Duration (#1327)NaiveDateTime const where possible (#1286)clock feature into clock and now (#1343, thanks @mmastrac)From<NaiveDate> for NaiveDateTime (#1355, thanks @dcechano)NaiveDateTime::from_timestamp_nanos (#1357, thanks @Ali-Mirghasemi)Months::num_months() and num_years() (#1373, thanks @danwilliams)DateTime<Utc>::from_timestamp_millis (#1374, thanks @xmakro)Duration::MIN.abs() (adjust Duration::MIN by 1 millisecond) (#1334)format functions (#1306)doc_auto_cfg (#1305, #1326)Add/Sub impls and use expect (#1316)TimeZone::datetime_from_str (#1342, thanks @tmccombs)Datelike impl for DateTime (#1376, thanks @ElectrifyPro)Archived* types in rkyv module (#1304)Archived* types (#1271, thanks @Awpteamoose)unstable-locales imply the alloc feature (#1307)format::{format_localized, format_item_localized} (#1311)write_rfc2822_inner, don't localize (#1322)DateTime::with_* (#1309)*_DAYS_FROM_YEAR_0 calculation (#1312)NaiveTime::overflowing_(add|sub)_offset (#1310)DateTime::overflowing_(add|sub)_offset (#1069)set env LC_ALL (#1315, thanks @jtmoon79)deny.toml (#1320)with: node-version (#1352, thanks @jtmoon79)toml job (#1371, thanks @gibbz00)Thanks to all contributors on behalf of the chrono team, @djc and @pitdicker!
Deprecate timestamp_nanos in favor of the non-panicking timestamp_nanos_opt
Another maintenance release. It was not a planned effort to improve our support for UNIX timestamps, yet most PRs seem related to this.
timestamp_nanos in favor of the non-panicking timestamp_nanos_opt (#1275)DateTime::<Utc>::from_timestamp (#1279, thanks @demurgos)TimeZone::timestamp_micros (#1285, thanks @emikitas)DateTime<Tz>::timestamp_nanos_opt and NaiveDateTime::timestamp_nanos_opt (#1275)UNIX_EPOCH constants (#1291)NaiveTime::from_hms_milliNaiveTime::from_hms_milli_optNaiveTime::from_hms_microNaiveTime::from_hms_micro_optNaiveTime::from_hms_nanoNaiveTime::from_hms_nano_optNaiveTime::from_num_seconds_from_midnightNaiveTime::from_num_seconds_from_midnight_optNaiveDate::and_hms_milliNaiveDate::and_hms_milli_optNaiveDate::and_hms_microNaiveDate::and_hms_micro_optNaiveDate::and_hms_nanoNaiveDate::and_hms_nano_optNaiveDateTime::from_timestampNaiveDateTime::from_timestamp_optTimeZone::timestampTimeZone::timestamp_optNaiveDateTime::timestamp_nanos_opt (#1294, thanks @crepererum)__doctest feature and doc_comment dependency (#1276)actions/checkout from 3 to 4 (#1280)NaiveDate::add_days for small values (#1214)pure-rust-locales to 0.7.0 (#1288, thanks @jeremija wo did good improvements on pure-rust-locales)Thanks to all contributors on behalf of the chrono team, @djc and @pitdicker!
This helps avoid warnings about the [CVE-2020-26235] and [RUSTSEC-2020-0071] advisories for downstream users and allows us to improve the Duration API…
In this release, we have decided to swap out the chrono::Duration type (which has been a re-export of time 0.1 Duration type) with our own definition, which exposes a strict superset of the time::Duration API. This helps avoid warnings about the CVE-2020-26235 and RUSTSEC-2020-0071 advisories for downstream users and allows us to improve the Duration API going forward.
While this is technically a SemVer-breaking change, we expect the risk of downstream users experiencing actual incompatibility to be exceedingly limited (see our analysis of public code using a crater-like experiment), and not enough justification for the large ecosystem churn of a 0.5 release. If you have any feedback on these changes, please let us know in #1268.
NaiveDate::leap_year (#1261)Timelike::num_seconds_from_midnight is a simple mapping (#1255)Rust first had a time module added to std in its 0.7 release. It later moved to libextra, and then to a libtime library shipped alongside the standard library. In 2014 work on chrono started in order to provide a full-featured date and time library in Rust. Some improvements from chrono made it into the standard library; notably, chrono::Duration was included as std::time::Duration (rust#15934) in 2014.
In preparation of Rust 1.0 at the end of 2014 libtime was moved out of the Rust distro and into the time crate to eventually be redesigned (rust#18832, rust#18858), like the num and rand crates. Of course chrono kept its dependency on this time crate. time started re-exporting std::time::Duration during this period. Later, the standard library was changed to have a more limited unsigned Duration type (rust#24920, RFC 1040), while the time crate kept the full functionality with time::Duration. time::Duration had been a part of chrono's public API.
By 2016 time 0.1 lived under the rust-lang-deprecated organisation and was not actively maintained (time#136). chrono absorbed the platform functionality and Duration type of the time crate in chrono#478 (the work started in chrono#286). In order to preserve compatibility with downstream crates depending on time and chrono sharing a Duration type, chrono kept depending on time 0.1. chrono offered the option to opt out of the time dependency by disabling the oldtime feature (swapping it out for an effectively similar chrono type). In 2019, @jhpratt took over maintenance on the time crate and released what amounts to a new crate as time 0.2.
In November of 2020 CVE-2020-26235 and RUSTSEC-2020-0071 were opened against the time crate. @quininer had found that calls to localtime_r may be unsound (chrono#499). Eventually, almost a year later, this was also made into a security advisory against chrono as RUSTSEC-2020-0159, which had platform code similar to time.
On Unix-like systems a process is given a timezone id or description via the TZ environment variable. We need this timezone data to calculate the current local time from a value that is in UTC, such as the time from the system clock. time 0.1 and chrono used the POSIX function localtime_r to do the conversion to local time, which reads the TZ variable.
Rust assumes the environment to be writable and uses locks to access it from multiple threads. Some other programming languages and libraries use similar locking strategies, but these are typically not shared across languages. More importantly, POSIX declares modifying the environment in a multi-threaded process as unsafe, and getenv in libc can't be changed to take a lock because it returns a pointer to the data (see rust#27970 for more discussion).
Since version 4.20 chrono no longer uses localtime_r, instead using Rust code to query the timezone (from the TZ variable or via iana-time-zone as a fallback) and work with data from the system timezone database directly. The code for this was forked from the tz-rs crate by @x-hgg-x. As such, chrono now respects the Rust lock when reading the TZ environment variable. In general, code should avoid modifying the environment.
Because time 0.1 has been unmaintained for years, however, the security advisory mentioned above has not been addressed. While chrono maintainers were careful not to break backwards compatibility with the time::Duration type, there has been a long stream of issues from users inquiring about the time 0.1 dependency with the vulnerability. We investigated the potential breakage of removing the time 0.1 dependency in chrono#1095 using a crater-like experiment and determined that the potential for breaking (public) dependencies is very low. We reached out to those few crates that did still depend on compatibility with time 0.1.
As such, for chrono 0.4.30 we have decided to swap out the time 0.1 Duration implementation for a local one that will offer a strict superset of the existing API going forward. This will prevent most downstream users from being affected by the security vulnerability in time 0.1 while minimizing the ecosystem impact of semver-incompatible version churn.
Thanks to all contributors on behalf of the chrono team, @djc and @pitdicker!
Deprecate TimeZone::datetime_from_str
This release fixes a panic introduced in chrono 0.4.27 in FromStr<DateTime<Utc>> (#1253).
Chrono now has a Discord channel.
parse_rfc3339_relaxed (#1254)TimeZone::datetime_from_str (#1251)FromStr for Weekday and Month (#1226, thanks @wfraser)i686 and wasm32-wasi (#1237)Thanks to all contributors on behalf of the chrono team, @djc and @pitdicker!
This release fixes a test failure on 32-bit targets introduced with 0.4.27, see https://github.com/chronotope/chrono/issues/1234.
This release fixes a test failure on 32-bit targets introduced with 0.4.27, see https://github.com/chronotope/chrono/issues/1234.
Deprecate DateTime::{from_local, from_utc}
This release bumps the MSRV from 1.56 to 1.57. This allows us to take advantage of the panicking in const feature. In this release most methods on NaiveDate and NaiveTime are made const, NaiveDateTime and others will follow in a later release.
The parser for the %+ formatting specifier and the RFC3339 formatting item is switched from a strict to a relaxed parser (see https://github.com/chronotope/chrono/pull/1145). This matches the existing documentation, and the parser used by DateTime::from_str. If you need to validate the input, consider using DateTime::from_rfc3339.
DateTime::{from_local, from_utc} (https://github.com/chronotope/chrono/pull/1175)DateTime::signed_duration_since take argument with Borrow (https://github.com/chronotope/chrono/pull/1119)PartialOrd for Month (https://github.com/chronotope/chrono/pull/999, thanks @Munksgaard)Ord and Eq for types which already derive PartialOrd and PartialEq (https://github.com/chronotope/chrono/pull/1128, thanks @totikom)FusedIterator for NaiveDateDaysIterator and NaiveDateWeeksIterator (https://github.com/chronotope/chrono/pull/1134)NaiveDateDaysIterator and NaiveDateWeeksIterator public (https://github.com/chronotope/chrono/pull/1134)FromStr for FixedOffset (https://github.com/chronotope/chrono/pull/1157, thanks @mcronce)Tz::Offset: Display requirement from DateTime::to_rfc* (https://github.com/chronotope/chrono/pull/1160)StrftimeItems with unstable-locales work without allocating (https://github.com/chronotope/chrono/pull/1152)NaiveDate::from_ymd_opt const (https://github.com/chronotope/chrono/pull/1172, thanks @kamadorueda)Error trait for ParseWeekdayError and ParseMonthError (https://github.com/chronotope/chrono/pull/539, thanks @mike-kfed)NaiveTime const, update MSRV to 1.57 (https://github.com/chronotope/chrono/pull/1080)NaiveDate const (https://github.com/chronotope/chrono/pull/1205)core::time::Duration on DateTime types (https://github.com/chronotope/chrono/pull/1229)timestamp_nanos panics on overflow in release builds (https://github.com/chronotope/chrono/pull/1123)offset_from_local_datetime for wasm_bindgen (https://github.com/chronotope/chrono/pull/1131)%s to be a timestamp in UTC (https://github.com/chronotope/chrono/pull/1136)%#z (https://github.com/chronotope/chrono/pull/1140, thanks @domodwyer)%c and %r (https://github.com/chronotope/chrono/pull/1165)unstable-locales feature (https://github.com/chronotope/chrono/pull/1168)Offset's Debug impl when serializing DateTime (https://github.com/chronotope/chrono/pull/1035)NaiveTime::from_str (https://github.com/chronotope/chrono/pull/1181)android-tzdata if the clock feature is not enabled (https://github.com/chronotope/chrono/pull/1220, thanks @AlexTMjugador)NaiveTime doc typo (https://github.com/chronotope/chrono/pull/1146, thanks @zachs18)Datelike::with_* (https://github.com/chronotope/chrono/pull/1199)Utc::now and Local::now (https://github.com/chronotope/chrono/pull/1192)Weekday::num_days_from_monday (https://github.com/chronotope/chrono/pull/1193)DateTime::to_rfc_* optimizations (https://github.com/chronotope/chrono/pull/1200)format/formatting.rs (https://github.com/chronotope/chrono/pull/1156)saturating_abs (https://github.com/chronotope/chrono/pull/1124)Makefile (https://github.com/chronotope/chrono/pull/1133)wasm-bindgen feature (https://github.com/chronotope/chrono/pull/1131)try_verify_against_date_command (https://github.com/chronotope/chrono/pull/1161)no_std (https://github.com/chronotope/chrono/pull/1166)test_parse (https://github.com/chronotope/chrono/pull/1170)#![deny(dead_code)] (https://github.com/chronotope/chrono/pull/1187)test_date_extreme_offset (https://github.com/chronotope/chrono/pull/1195)features-check (https://github.com/chronotope/chrono/pull/1216)Thanks to all contributors on behalf of the chrono team, @djc and @pitdicker!
The changes from #807 we merged for 0.4.25 unfortunately restricted parsing in a way that was incompatible with earlier 0.4.x releases. We reverted th
The changes from #807 we merged for 0.4.25 unfortunately restricted parsing in a way that was incompatible with earlier 0.4.x releases. We reverted this in #1113. A small amount of other changes were merged since.
DurationRound panics from issue #1010 (#1093, thanks to @pitdicker)Thanks on behalf of the chrono team (@djc and @esheppa) to all contributors!
Fix doctest warnings, remove mention of deprecated methods from main doc (#1081, thanks to @pitdicker)
Time for another maintenance release. This release bumps the MSRV to 1.56; given MSRV bumps in chrono's dependencies (notably for syn 2), we felt that it no longer made sense to support any older versions. Feedback welcome in our issue tracker!
NaiveDateTime::and_utc() method (#952, thanks to @klnusbaum)Hash for most pub types that also derive PartialEq (#938, thanks to @bruceg)parse_and_remainder() methods (#1011, thanks to @pitdicker)DateTime::fix_offset() (#1030, thanks to @pitdicker)#[track_caller] to LocalResult::unwrap (#1046, thanks to @pitdicker)#[must_use] to some methods (#1007, thanks to @aceArt-GmbH)PartialOrd for Month (#999, thanks to @Munksgaard)impl From<NaiveDateTime> for NaiveDate (#1012, thanks to @pezcore)NaiveWeek::last_day (#1070, thanks to @pitdicker)Local to FixedOffset (#1041, thanks to @pitdicker)Local (#992, thanks to @nekevss)clock feature (#1061, thanks to @pitdicker)--no-default-features (#1059, thanks to @pitdicker)bench_year_flags_from_year from being optimized out (#1034, thanks to @pitdicker)test_datetime_parse_from_str (#1078, thanks to @pitdicker)set -eux, use bash (#1103, thanks to @jtmoon79)LANG to c in gnu date (#1089, thanks to @scarf005)TryFrom (#1086, thanks to @pitdicker)On behalf of @djc and @esheppa, thanks to all contributors!
Update deprecated methods in from_utc() example (#939, thanks to @greg-el)
This is a small maintenance release with accumulated fixes and improvements.
Days::new() to refer to days, not months (#874, thanks to @brotskydotcom)from_timestamp_opt() (#879, thanks to @xmo-odoo)format_localized() for NaiveDate (#881, thanks to @mseele)Add/Sub Days, add tests with DST timezone (#878)NaiveTime::MIN public (#890)from_timestamp_millis() implementation and add more tests (#885)from_timestamp_micros() function (#906, thanks to @umanwizard)Hash for most pub types that also derive PartialEq (#938, thanks to @bruceg)from_utc() example (#939, thanks to @greg-el)DateTime::checked_add_days() (#942, thanks to @Ekleog)FixedOffset docs (#953, thanks to @klnusbaum)const (#984, thanks to @tormeh)Thanks to all contributors from the chrono team, @esheppa and @djc.
…for the 0.5.0 release. As such, we've started deprecating some APIs that are likely to be removed in 0.5. If you have any feedback on these changes, p…
0.4.23 is the next 0.4 release of the popular chrono date and time library for Rust. After the 0.4.20-0.4.22 series that brought chrono back to life after a long hiatus, development has been fairly quiet, allowing us to start planning changes for the 0.5.0 release. As such, we've started deprecating some APIs that are likely to be removed in 0.5. If you have any feedback on these changes, please let us know in the issue tracker!
_opt() alternative (#827)Date<Tz> type (#851)Days type (#784)NaiveDateTime::from_timestamp_millis(_opt) (#818, thanks to @Pscheidl -- backported in #823)Local timezone (#853)arbitrary::Arbitrary trait (#849, thanks to @greyblake and @asayers)On behalf of @esheppa and @djc, thanks to all contributors!
Unfortunately the introduction of the iana-time-zone dependency in 0.4.21 caused some new regressions with lesser known platforms. This release fixes
Unfortunately the introduction of the iana-time-zone dependency in 0.4.21 caused some new regressions with lesser known platforms. This release fixes all of the issues we've encountered, improving the situation on some WebAssembly targets, SGX and on macOS/iOS. We've improved our CI setup to hopefully catch more of these issues before release in the future.
wasm32-unknown-unknown target (#771)x86_64-fortanix-unknown-sgx (#767, thanks to @trevor-crypto)iana-time-zone version to 0.1.44 to avoid cyclic dependencies (#773, thanks to @Kijewski for the upstream PRs)0.4.21 is a bugfix release that mainly fixes one regression from 0.4.20:
0.4.21 is a bugfix release that mainly fixes one regression from 0.4.20:
TimeZone::now() fell back to UTC in the case it could not find the current timezone, but the new implementation panicked in that case./etc/localtime to keep track of the current timezone. Instead we now use the iana-time-zone crate as a dependency, since it already has quite a bit of logic for finding the current timezone on a host of platforms.Additionally, there is a documentation fix that reverts an incorrect guarantee:
%Y can have a negative value, both in formatting and in parsing (#760, thanks to @alex)…though chrono 0.4.20 does not depend on the vulnerable parts of the time 0.1.x versions. In a future 0.5 release, we will remove the time dependency.
chrono is a date and time library for Rust and 0.4.20 is the first chrono release since Sep 2020. There has been a long hiatus since the previous maintainer was no longer able to spend much time on the crate; thanks to @quodlibetor for their stewardship of the chrono crate for many years! The new maintainers are @djc and @esheppa. Our first priority has been fixing the soundness issues with calls to localtime_r() as first reported in #499 and the RUSTSEC-2020-0159 advisory. In order to do this we adapted code from the tz-rs crate maintained by @x-hgg-x for use within chrono -- thanks for working on that! With the new implementation, chrono uses safe Rust code to parse the timezone data files on Unix platforms directly instead of relying on libc.
Due to compatibility reasons, this release does not yet remove the time 0.1 dependency, though chrono 0.4.20 does not depend on the vulnerable parts of the time 0.1.x versions. In a future 0.5 release, we will remove the time dependency.
The minimum supported Rust version for 0.4.20 is 1.32.0, which is intentionally still quite conservative. If you are using chrono 0.4 with a Rust version older than 1.52, we'd like to hear from you since we'd like to further modernize the code base to ease maintenance.
localtime_r() by parsing timezone files in Rust on Unix (#677 and #728)Duration::abs() behavior in case of negative durations with nanoseconds (#734, thanks to @abreis)ParserErrorKind public and available through ParseError::kind() (#588, thanks to @sbrocket)MIN and MAX const values in favor of free-standing consts (#726)NaiveDate (#732 with follow up in #752, thanks to @avantgardnerio)NaiveWeek type to facilitate week-based calculations (#666, thanks to @sestrella)NaiveDateTime::and_local_timezone() method (#711, thanks to @botahamec)DateTime::from_local() method (#572, thanks to @retrhelo)NaiveDateTime (#664, thanks to @nickelc)DoubleEndedIterator for NaiveDateDaysIterator/NaiveDateWeeksIterator (#697, thanks to @teobouvard)std::iter::Sum for Duration (#522, thanks to @jakevossen5)years_since() method to DateTime/Date (#557 then #707, thanks to @yozhgoor)AddAssign/SubAssign for DateTime/Date (#698, thanks to @MrGunflame)Utc::now() (#647, thanks to @ModProg)DateTime::with_timezone() (#747, thanks to @kevincox)naive serde integration (#616, thanks to @nickelc)extern crate statements and outdated comments (#665, thanks to @nickelc)…though chrono 0.4.20 does not depend on the vulnerable parts of the time 0.1.x versions. In a future 0.5 release, we will remove the time dependency.
0.4.20 is the first chrono release since Sep 2020. There has been a long hiatus since the previous maintainer was no longer able to spend much time on the crate; thanks to @quodlibetor for their stewardship of the chrono crate for many years! The new maintainers are @djc and @esheppa. Our first priority has been fixing the soundness issues with calls to localtime_r() as first reported in #499 and the RUSTSEC-2020-0159 advisory. In order to do this we adapted code from the tz-rs crate maintained by @x-hgg-x for use within chrono -- thanks for working on that! With the new implementation, chrono uses safe Rust code to parse the timezone data files on Unix platforms directly instead of relying on libc.
Due to compatibility reasons, this release does not yet remove the time 0.1 dependency, though chrono 0.4.20 does not depend on the vulnerable parts of the time 0.1.x versions. In a future 0.5 release, we will remove the time dependency.
The minimum supported Rust version for 0.4.20 is 1.32.0, which is intentionally still quite conservative. If you are using chrono 0.4 with a Rust version older than 1.52, we'd like to hear from you since we'd like to further modernize the code base to ease maintenance.
localtime_r() by parsing timezone files in Rust on Unix (#677 and #728)Duration::abs() behavior in case of negative durations with nanoseconds (#734, thanks to @abreis)ParserErrorKind public and available through ParseError::kind() (#588, thanks to @sbrocket)MIN and MAX const values in favor of free-standing consts (#726)NaiveDate (#732 with follow up in #752, thanks to @avantgardnerio)NaiveWeek type to facilitate week-based calculations (#666, thanks to @sestrella)NaiveDateTime::and_local_timezone() method (#711, thanks to @botahamec)DateTime::from_local() method (#572, thanks to @retrhelo)NaiveDateTime (#664, thanks to @nickelc)DoubleEndedIterator for NaiveDateDaysIterator/NaiveDateWeeksIterator (#697, thanks to @teobouvard)std::iter::Sum for Duration (#522, thanks to @jakevossen5)years_since() method to DateTime/Date (#557 then #707, thanks to @yozhgoor)AddAssign/SubAssign for DateTime/Date (#698, thanks to @MrGunflame)Utc::now() (#647, thanks to @ModProg)DateTime::with_timezone() (#747, thanks to @kevincox)naive serde integration (#616, thanks to @nickelc)extern crate statements and outdated comments (#665, thanks to @nickelc)Bump version to 0.4.20-beta.1
Bump version to 0.4.20-beta.1
Correct build on solaris/illumos.
Correct build on solaris/illumos.
Restore support for x86_64-fortanix-unknown-sgx.
Restore support for x86_64-fortanix-unknown-sgx.
Fix a name resolution error in wasm-bindgen code introduced by removing the dependency on time v0.1.
Fix a name resolution error in wasm-bindgen code introduced by removing the dependency on time v0.1.
Drop the dependency on time v0.1, which is deprecated, unless the oldtime feature is active. This feature is active by default in v0.4.16 for backward…
Add %Z specifier to the FromStr, similar to the glibc strptime (does not set the offset from the timezone name)
Drop the dependency on time v0.1, which is deprecated, unless the oldtime feature is active. This feature is active by default in v0.4.16 for backwards compatibility, but will likely be removed in v0.5. Code that imports time::Duration should be switched to import chrono::Duration instead to avoid breakage.
Correct usage of vec in specific feature combinations (@quodlibetor)
Add day and week iterators for NaiveDate (@gnzlbg & @robyoung)
NaiveDate (@gnzlbg & @robyoung)Month enum (@hhamana)locales. All format functions can now use locales, see the documentation for the unstable-locales feature.Local.from_local_datetime method for wasmNaiveTime, NaiveDateTime and DateTime<Utc>.Add DurationRound trait that allows rounding and truncating by Duration (@robyoung)
DurationRound trait that allows rounding and truncating by Duration (@robyoung)From for js_sys in wasm to reuse code (@schrieveslaach)Duration::abs to ensure that a duration is just a magnitude (#418 @abreis).
Duration::abs to ensure that a duration is just a magnitude (#418 @abreis).From for js_sys in wasm (#424 @schrieveslaach)time for redox support.Option types (#417 @mwkroening and #429 @fx-kirin)Avoid deprecation warnings for Error::description (@AnderEnder and @quodlibetor #376)
T in FromStr for DateTime<Tz>, meaning that e.g.
dt.to_string().parse::<DateTime<Utc>>() now correctly works on round-trip.
(@quodlibetor in #378)parse_from_rfc2822 (@quodlibetor #368 reported in
#102)Error::description (@AnderEnder and
@quodlibetor #376)Migrate from try! -> ? (question mark) because it is now emitting deprecation warnings and has been stable since rustc 1.13.0
alloc feature to improve no-std support (in #341) means that if you were relying on chrono with no-default-features and using any of the functions that require alloc support (i.e. any of the string-generating functions like to_rfc3339) you will need to add the alloc feature in your Cargo.toml.DateTime::parse_from_str is more than 2x faster in some cases. (@michalsrb #358)Iterator of Items (for example format_with_items) now accept Iterator of Borrow<Item>, so one can use values or references. (@michalsrb #358)Option<Datetime> etc fields (@manifest #302)strftime docs page (@qudlibetor #359)try! -> ? (question mark) because it is now emitting deprecation warnings and has been stable since rustc 1.13.0Make Datetime arithmatic adjust their offsets after discovering their new timestamps (@quodlibetor #337)
wasm-bindgen related code and dependencies behind a wasmbind feature gate. (@quodlibetor #335)wasmbind feature
gate. (@quodlibetor #335)Add '0' to single-digit days in rfc2822 date format ( @wyhaya #323 )
Disable libc default features so that CI continues to work on rust 1.13
LocalResult Copy/Eq/Hashstd::convert::From conversions between the different timezone formats (@mqudsi #271)timestamp_nanos methods (@jean-airoldie #308)Doc improvements -- improve README CI verification, external links
NaiveDate::from_weekday_of_month{,_opt} for getting eg. the 2nd Friday of March 2017.Added several more serde deserialization helpers (@novacrazy #258)
Hash on FixedOffset (@LuoZijun #254)Added support for parsing nanoseconds without the leading dot (@emschwartz #251)
Added methods to DateTime/NaiveDateTime to present the stored value as a number of nanoseconds since the UNIX epoch (@harkonenbade #247)
More strongly deprecate RustcSerialize: remove it from documentation unless the feature is enabled, issue a deprecation warning if the rustc-serialize…
clock feature, for use in environments where we don't have access to the current time. (@jethrogb #236)Dates, Times, or DateTimes, returning a Duration (@tobz1000 #237)Allow parsing timestamps with subsecond precision (@jonasbb)
timestamp_millis method on DateTime and NaiveDateTim that returns number of milliseconds since the epoch. (@quodlibetor)to_rfc3339_opts method on DateTime (@dekellum)SubsecRound trait that allows rounding to the nearest second (@dekellum)timestamp_millis method on DateTime and NaiveDateTime that returns
number of milliseconds since the epoch. (@quodlibetor)to_rfc3339_opts method on DateTime (@dekellum)SubsecRound trait that allows rounding to the nearest second
(@dekellum)To the end, the new major release was made with some known lower-priority breaking changes. 0.3.1 is now yanked and any remaining 0.3 users can safely…
Original annoucement: https://users.rust-lang.org/t/chrono-0-4-0-is-out/11466.
The new version of Chrono, the date and time library for Rust, has been released.
This version fixes the dependency issues raised in 0.3.1 (in lieu of this release, 0.3.1 is now yanked as well) while moving towards the more idiomatic API convention. This version was developed in relatively heavy time constraints, but I have managed to include several goodies:
DateTime types can now be serialized to, or deserialized from the integral UNIX timestamp.DateTime types and std::time::SystemTime can be freely converted back and forth via From.IsoWeek type has been introduced.This was originally planned as a minor release but was pushed to a major release due to the compatibility concern raised.
IsoWeek has been added for the ISO week without time zone.
The += and -= operators against time::Duration are now supported for NaiveDate, NaiveTime and NaiveDateTime. (#99)
(Note that this does not invalidate the eventual deprecation of time::Duration.)
SystemTime and DateTime<Tz> types can be now converted to each other via From. Due to the obvious lack of time zone information in SystemTime, the forward direction is limited to DateTime<Utc> and DateTime<Local> only.
Intermediate implementation modules have been flattened (#161), and UTC has been renamed to Utc in accordance with the current convention (#148).
The full list of changes is as follows:
| Before | After |
|---|---|
chrono::date::Date |
chrono::Date |
chrono::date::MIN |
chrono::MIN_DATE |
chrono::date::MAX |
chrono::MAX_DATE |
chrono::datetime::DateTime |
chrono::DateTime |
chrono::naive::time::NaiveTime |
chrono::naive::NaiveTime |
chrono::naive::date::NaiveDate |
chrono::naive::NaiveDate |
chrono::naive::date::MIN |
chrono::naive::MIN_DATE |
chrono::naive::date::MAX |
chrono::naive::MAX_DATE |
chrono::naive::datetime::NaiveDateTime |
chrono::naive::NaiveDateTime |
chrono::offset::utc::UTC |
chrono::offset::Utc |
chrono::offset::fixed::FixedOffset |
chrono::offset::FixedOffset |
chrono::offset::local::Local |
chrono::offset::Local |
chrono::format::parsed::Parsed |
chrono::format::Parsed |
With an exception of Utc, this change does not affect any direct usage of chrono::* or chrono::prelude::* types.
Datelike::isoweekdate is replaced by Datelike::iso_week which only returns the ISO week.
The original method used to return a tuple of year number, week number and day of the week, but this duplicated the Datelike::weekday method and it had been hard to deal with the raw year and week number for the ISO week date. This change isolates any logic and API for the week date into a separate type.
NaiveDateTime and DateTime can now be deserialized from an integral UNIX timestamp. (#125)
This turns out to be very common input for web-related usages. The existing string representation is still supported as well.
chrono::serde and chrono::naive::serde modules have been added for the serialization utilities. (#125)
Currently they contain the ts_seconds modules that can be used to serialize NaiveDateTime and DateTime values into an integral UNIX timestamp. This can be combined with Serde's [de]serialize_with attributes to fully support the (de)serialization to/from the timestamp.
For rustc-serialize, there are separate chrono::TsSeconds and chrono::naive::TsSeconds types that are newtype wrappers implementing different (de)serialization logics. This is a suboptimal API, however, and it is strongly recommended to migrate to Serde.
The major version was made to fix the broken Serde dependency issues. (#146, #156, #158, #159)
The original intention to technically break the dependency was to facilitate the use of Serde 1.0 at the expense of temporary breakage. Whether this was appropriate or not is quite debatable, but it became clear that there are several high-profile crates requiring Serde 0.9 and it is not feasible to force them to use Serde 1.0 anyway.
To the end, the new major release was made with some known lower-priority breaking changes. 0.3.1 is now yanked and any remaining 0.3 users can safely roll back to 0.3.0.
Various documentation fixes and goodies. (#92, #131, #136)
This is technically a breaking change because Serde 0.9 and 1.0 are not compatible, but this time we decided not to issue a minor version because we h…
Weekday now implements FromStr, Serialize and Deserialize. (#113)
The syntax is identical to %A, i.e. either the shortest or the longest form of English names.
Serde 1.0 is now supported. (#142)
This is technically a breaking change because Serde 0.9 and 1.0 are not compatible, but this time we decided not to issue a minor version because we have already seen Serde 0.8 and 0.9 compatibility problems even after 0.3.0 and a new minor version turned out to be not very helpful for this kind of issues.
Note that the actually published version is very slightly different from the repository because no published version of bincode supports Serde 1.0 right now.
So the following is the list of breaking changes primarily relevant to the users.
Original announcement: https://users.rust-lang.org/t/chrono-0-3-released-and-the-future/9340
So Chrono 0.3.0, a much delayed major version of Rust date and time library, is here. Update and watch your build breaking Enjoy.
I have described all changes to the changelog but the recent issue seems to indicate that it is not enough. So the following is the list of breaking changes primarily relevant to the users.
Rust 1.13.0 or later is required.
As we have moved to Serde 0.9, we have bumped the minimal supported version to 1.13.0. It is possible to use Chrono on older versions with or without Serde (previously 1.8.0 was the minimal, and Serde 0.9 seems to work well with 1.12.0) but they are no longer supported now.
The subtraction between two time instants/points is gone.
You should use a.signed_duration_since(b) instead of a - b. As you can expect, this name is very similar to the standard library's one, but returns time::Duration instead of std::time::Duration. The proper name, duration_since has been reserved for the transition.
(As aside, I don't think that the subtraction operator in this case will return. It is very awkward to return Result<Duration, NegativeDuration> from an operator, and risking the panic every time one subtract two normal points seems to be unreasonable.)
I don't know if these methods are used a lot, but checked_{add,sub} and overflowing_{add,sub} methods had met the same fate: They are now called checked_{add,sub}_signed and overflowing_{add,sub}_signed, respectively. The older names are reserved for the transition.
Rustc-serialize support is now exactly identical to the counterpart for Serde.
Previously two implementations didn't agree to each other primarily because they are written by different contributors. Now they standardize on the std::fmt::Debug output, previously used by Serde implementations. This will cause the format change if you are using rustc-serialize to read and write a long lasting format, so you should be prepared for it.
Rustc-serialize implementations actually covered more types than Serde in the past. They are now removed---more specifically, Date<Tz> and all offset types (DateTime<Tz> support is rewritten per each Tz). While it is not very trivial to reintroduce them in a sane manner, this removal should be considered temporary.
This release contains lots of other minor breaking changes to allow more changes without breaking the compatibility. (Many fixes were blocked by them, for instance.)
The most significant one is that we no longer use Duration (that is, time::Duration) for representing the time zone offset. It might sound strange but Offset is the "storage" offset type and Offset::local_minus_utc used to return the Duration for the offset "value". Now the offset
"value" is represented by FixedOffset (which is also a stroage type by its own), which has a good side effect that the offset is guaranteed to be within one day. In my experience this was a single biggest problem in implementing advanced time zone support---I expect this can be done much better by now.
We have also sorted out any types that were too public to be extended without breaking changes. For 0.3.0 they consist solely of formatting types, and they have received a private (dummy) field for the future expansion. We can now extend formatting (privately) without breaking public interfaces.
There are two major concerns in the far future (I mean, next year or so) of Chrono.
First, Chrono will become a community project at last. I had initiated and maintained the project so far, but in the last year (2016) I had significant energy depletion that has prevented me to do anything that is not a daily job (as you may know, I also use Rust at work). Not that I think that the current version is good enough---I've resolved many required breaking changes I was aware of during the 0.3.0 release for example.
The Chronotope organization is, I think, the major step towards the community project, but that is not enough. I have reserved it in the past, but I invite you to #chronotope IRC channel at irc.mozilla.org. Also I'm willing to invite more contributors and relevant projects to the
organization (chrono-tz comes to my mind). I'm not sure how to start but having a venue for the discussion could be a good start.
Second, Chrono will set the official relationship to the standard library types. std::time::Duration support is the beginning, and what I'm most concerned is std::time::SystemTime.
In the past I thought that the time library will be kept as is and Chrono will fill the niche gap. The situation has changed—SystemTime no longer concerns about the calendar time. This means that the Chrono date and time types should be a canonical type for the calendar time while also filling the niche. This discrepancy was a source of design issues:
People seems to use DateTime<Tz> as a primary storage type, rather than as an alternative type used for formatting and calculation.
While it is designed to be much faster than alternatives, Chrono's main representation still is a calendar time and causes overhead when you don't need that. SystemTime::now() is at least 10x faster than UTC::now().
The TimeZone type parameter is a source of many complaints. The original design was selected so that we don't have to deal with the synchronization or sharing issue, and also we can get the needed information for date and time calculation, but my observation is that calculation is less used than formatting.
There are several approaches to solve them, and I have one particular approach in mind—removing a TimeZone parameter at all and delegating all tz-aware operation to the external object. The alternative datetime library seems to explore another possibiltiy (to make the time zone object internal) as well. No matter which design is selected, I believe this needs many eyes to perfect, and want to gather users' feedback as well.
The project has moved to the Chronotope organization.
chrono::prelude module has been added. All other glob imports are now discouraged.
FixedOffset can be added to or subtracted from any timelike types.
FixedOffset::local_minus_utc and FixedOffset::utc_minus_local methods have been added. Note that the old Offset::local_minus_utc method is gone; see below.Serde support for non-self-describing formats like Bincode is added. (#89)
Added Item::Owned{Literal,Space} variants for owned formatting items. (#76)
Formatting items and the Parsed type have been slightly adjusted so that they can be internally extended without breaking any compatibility.
Weekday is now Hashable. (#109)
ParseError now implements Eq as well as PartialEq. (#114)
More documentation improvements. (#101, #108, #112)
Chrono now only supports Rust 1.13.0 or later (previously: Rust 1.8.0 or later).
Serde 0.9 is now supported. Due to the API difference, support for 0.8 or older is discontinued. (#122)
Rustc-serialize implementations are now on par with corresponding Serde implementations.
They both standardize on the std::fmt::Debug textual output.
This is a silent breaking change (hopefully the last though). You should be prepared for the format change if you depended on rustc-serialize.
Offset::local_minus_utc is now Offset::fix, and returns FixedOffset instead of a duration.
This makes every time zone operation operate within a bias less than one day, and vastly simplifies many logics.
chrono::format::format now receives FixedOffset instead of time::Duration.
The following methods and implementations have been renamed and older names have been removed.
The older names will be reused for the same methods with std::time::Duration in the future.
checked_* → checked_*_signed in Date, DateTime, NaiveDate and NaiveDateTime types
overflowing_* → overflowing_*_signed in the NaiveTime type
All subtraction implementations between two time instants have been moved to signed_duration_since, following the naming in std::time.
Local offset receives a leap second. (#123)Rustc-serialize support for Date<Tz> types and all offset types has been dropped.
These implementations were automatically derived and never had been in a good shape. Moreover there are no corresponding Serde implementations, limiting their usefulness. In the future they may be revived with more complete implementations.
The following method aliases deprecated in the 0.2 branch have been removed.
DateTime::num_seconds_from_unix_epoch (→ DateTime::timestamp)NaiveDateTime::from_num_seconds_from_unix_epoch (→ NaiveDateTime::from_timestamp)NaiveDateTime::from_num_seconds_from_unix_epoch_opt (→ NaiveDateTime::from_timestamp_opt)NaiveDateTime::num_seconds_unix_epoch (→ NaiveDateTime::timestamp)Formatting items are no longer Copy, except for chrono::format::Pad.
chrono::offset::add_with_leapsecond has been removed.
Use a direct addition with FixedOffset instead.
This is the last version officially supports Rust 1.12.0 or older.
This is the last version officially supports Rust 1.12.0 or older.
(0.2.24 was accidentally uploaded without a proper check for warnings in the default state, and replaced by 0.2.25 very shortly. Duh.)
This is the last version officially supports Rust 1.12.0 or older.
(0.2.24 was accidentally uploaded without a proper check for warnings in the default state, and replaced by 0.2.25 very shortly. Duh.)
Serde 0.8 is now supported. 0.7 also remains supported.
The documentation was greatly improved for several types, and tons of cross-references have been added. (#77, #78, #80, #82)
The documentation was greatly improved for several types, and tons of cross-references have been added. (#77, #78, #80, #82)
DateTime::timestamp_subsec_{millis,micros,nanos} methods have been added. (#81)
When the system time records a leap second, the nanosecond component was mistakenly reset to zero. (#84)
Local offset misbehaves in Windows for August and later, due to the long-standing libtime bug (dates back to mid-2015).
Workaround has been implemented. (#85)
%.6f and %.9f used to print only three digits when the nanosecond part is zero.
%.6f and %.9f used to print only three digits when the nanosecond part is zero. (#71)%+ has been updated to reflect the current status. (#71)Fixed::LongWeekdayName was unable to recognize "sunday" (whoops).
Fixed::LongWeekdayName was unable to recognize "sunday" (whoops). (#66)serde dependency has been updated to 0.7. (#63, #64)
serde dependency has been updated to 0.7. (#63, #64)The documentation for Date is made clear about its ambiguity and guarantees.
Date is made clear about its ambiguity and guarantees.DateTime::date had been wrong when the local date and the UTC date is in disagreement. (#61)Chrono no longer pulls a superfluous rand dependency.
rand dependency. (#57)Naive date and time types and DateTime now have a serde support. They serialize as an ISO 8601 / RFC 3339 string just like Debug.
DateTime now have a serde support.
They serialize as an ISO 8601 / RFC 3339 string just like Debug. (#51)Added %.3f, %.6f and %.9f specifier for formatting fractional seconds up to 3, 6 or 9 decimal digits. This is a natural extension to the existing %f.
Added %.3f, %.6f and %.9f specifier for formatting fractional seconds up to 3, 6 or 9 decimal digits. This is a natural extension to the existing %f. Note that this is (not yet) generic, no other value of precision is supported. (#45)
Tons of supporting examples for the documentation have been added. More to come.
Datelike and Timelike. This does not make a big harm as any type implementing them should be already sized to be practical, but this change still can break highly generic codes. (#46)README.md. (#41)One column per quarter.