Releases: chronotope/chrono
v0.4.20
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.
Fixes
- Fix unsound call to
localtime_r()
by parsing timezone files in Rust on Unix (#677 and #728) - Allow RFC 2822 parser to deal with comments (#733 then #737, thanks to @Finomnis)
- Avoid panicking during parsing (#686, thanks to @botahamec)
- Avoid panics when rounding durations (#659, thanks to @ARBaart)
- Fix
Duration::abs()
behavior in case of negative durations with nanoseconds (#734, thanks to @abreis)
Additions
- Make
ParserErrorKind
public and available throughParseError::kind()
(#588, thanks to @sbrocket) - Expose associated
MIN
andMAX
const values in favor of free-standing consts (#726) - Add (optional) support for rkyv (#644 and #701, thanks to @dovahcrow)
- Support month-based calculations against
NaiveDate
(#732 with follow up in #752, thanks to @avantgardnerio) - Add
NaiveWeek
type to facilitate week-based calculations (#666, thanks to @sestrella) - Add
NaiveDateTime::and_local_timezone()
method (#711, thanks to @botahamec) - Add
DateTime::from_local()
method (#572, thanks to @retrhelo) - Extend serde integration for
NaiveDateTime
(#664, thanks to @nickelc) - Implement
DoubleEndedIterator
forNaiveDateDaysIterator
/NaiveDateWeeksIterator
(#697, thanks to @teobouvard) - Implement
std::iter::Sum
forDuration
(#522, thanks to @jakevossen5) - Add
years_since()
method toDateTime
/Date
(#557 then #707, thanks to @yozhgoor) - Implement
AddAssign
/SubAssign
forDateTime
/Date
(#698, thanks to @MrGunflame) - Fix imports on WASM targets (#672, thanks to @danielalvsaaker)
- Implement std::error::Error for ParseWeekdayError (#745)
Non-functional improvements
- Improve CI to better exercise WASM targets (#662, thanks to @AmateurECE)
- More WASM testing improvements, enable dependencies by default (#746)
- Fix compiling for wasm32-unknown-emscripten target (#568, thanks to @orion78fr)
- Use stub implementation for anything not unix and not windows (#593, thanks to @yu-re-ka)
- Remove now unused libc dependency (#710, thanks to @metent)
- Clean up some clippy warnings (#721, thanks to @botahamec)
- Clarify documentation for
Utc::now()
(#647, thanks to @ModProg) - Clarify documentation for
DateTime::with_timezone()
(#747, thanks to @kevincox) - Improve examples for
naive
serde integration (#616, thanks to @nickelc) - Clean up
extern crate
statements and outdated comments (#665, thanks to @nickelc) - Fix typo in deprecation notice (#744, thanks to @Mike-Dax)
- Fix some typos in documentation (#680 and #695, thanks to @cuishuang and @fxredeemer)
- Implement caching for CI (#609, thanks to @Milo123459)
v0.4.20-rc.1
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.
Fixes
- Fix unsound call to
localtime_r()
by parsing timezone files in Rust on Unix (#677 and #728) - Allow RFC 2822 parser to deal with comments (#733 then #737, thanks to @Finomnis)
- Avoid panicking during parsing (#686, thanks to @botahamec)
- Avoid panics when rounding durations (#659, thanks to @ARBaart)
- Fix
Duration::abs()
behavior in case of negative durations with nanoseconds (#734, thanks to @abreis)
Additions
- Make
ParserErrorKind
public and available throughParseError::kind()
(#588, thanks to @sbrocket) - Expose associated
MIN
andMAX
const values in favor of free-standing consts (#726) - Add (optional) support for rkyv (#644 and #701, thanks to @dovahcrow)
- Support month-based calculations against
NaiveDate
(#732 with follow up in #752, thanks to @avantgardnerio) - Add
NaiveWeek
type to facilitate week-based calculations (#666, thanks to @sestrella) - Add
NaiveDateTime::and_local_timezone()
method (#711, thanks to @botahamec) - Add
DateTime::from_local()
method (#572, thanks to @retrhelo) - Extend serde integration for
NaiveDateTime
(#664, thanks to @nickelc) - Implement
DoubleEndedIterator
forNaiveDateDaysIterator
/NaiveDateWeeksIterator
(#697, thanks to @teobouvard) - Implement
std::iter::Sum
forDuration
(#522, thanks to @jakevossen5) - Add
years_since()
method toDateTime
/Date
(#557 then #707, thanks to @yozhgoor) - Implement
AddAssign
/SubAssign
forDateTime
/Date
(#698, thanks to @MrGunflame) - Fix imports on WASM targets (#672, thanks to @danielalvsaaker)
- Implement std::error::Error for ParseWeekdayError (#745, after rc.1)
Non-functional improvements
- Improve CI to better exercise WASM targets (#662, thanks to @AmateurECE)
- More WASM testing improvements, enable dependencies by default (#746)
- Fix compiling for wasm32-unknown-emscripten target (#568, thanks to @orion78fr)
- Use stub implementation for anything not unix and not windows (#593, thanks to @yu-re-ka)
- Remove now unused libc dependency (#710, thanks to @metent)
- Clean up some clippy warnings (#721, thanks to @botahamec)
- Clarify documentation for
Utc::now()
(#647, thanks to @ModProg) - Clarify documentation for
DateTime::with_timezone()
(#747, thanks to @kevincox) - Improve examples for
naive
serde integration (#616, thanks to @nickelc) - Clean up
extern crate
statements and outdated comments (#665, thanks to @nickelc) - Fix typo in deprecation notice (#744, thanks to @Mike-Dax)
- Fix some typos in documentation (#680 and #695, thanks to @cuishuang and @fxredeemer)
- Implement caching for CI (#609, thanks to @Milo123459)
v0.4.19
Correct build on solaris/illumos.
v0.4.18
Restore support for x86_64-fortanix-unknown-sgx
.
v0.4.17
Fix a name resolution error in wasm-bindgen
code introduced by removing the dependency on time v0.1.
v0.4.16
-
Add %Z specifier to the
FromStr
, similar to the glibcstrptime
(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 importstime::Duration
should be switched to importchrono::Duration
instead to avoid breakage.
v0.4.15
Fixes
- Correct usage of vec in specific feature combinations (@quodlibetor)
v0.4.14
Features
- Add day and week iterators for
NaiveDate
(@gnzlbg & @robyoung) - Add a
Month
enum (@hhamana) - Add
locales
. All format functions can now use locales, see the documentation for theunstable-locales
feature. - Fix
Local.from_local_datetime
method for wasm
Improvements
- Added MIN and MAX values for
NaiveTime
,NaiveDateTime
andDateTime<Utc>
.
v0.4.13
Features
- Add
DurationRound
trait that allows rounding and truncating byDuration
(@robyoung)
Internal Improvements
- Code improvements to impl
From
forjs_sys
in wasm to reuse code (@schrieveslaach)
v0.4.12
New Methods and impls
Compatibility improvements
- impl
From
forjs_sys
in wasm (#424 @schrieveslaach) - Bump required version of
time
for redox support.
Bugfixes
- serde modules do a better job with
Option
types (#417 @mwkroening and #429 @fx-kirin) - Use js runtime when using wasmbind to get the local offset (#412 @quodlibetor)
Internal Improvements
- Migrate to github actions from travis-ci, make the overall CI experience more comprehensible, significantly faster and more correct (#439 @quodlibetor)