24 KiB
ChangeLog for Chrono
This documents all notable changes to Chrono.
Chrono obeys the principle of Semantic Versioning, with one caveat: we may
move previously-existing code behind a feature gate and put it behind a new feature. This new
feature will always be placed in the previously-default feature, which you can use to prevent
breakage if you use no-default-features.
There were/are numerous minor versions before 1.0 due to the language changes. Versions with only mechanical changes will be omitted from the following list.
0.4.20 (unreleased)
0.4.19
- Correct build on solaris/illumos
0.4.18
- Restore support for x86_64-fortanix-unknown-sgx
0.4.17
- Fix a name resolution error in wasm-bindgen code introduced by removing the dependency on time v0.1
0.4.16
Features
-
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
oldtimefeature 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::Durationshould be switched to importchrono::Durationinstead to avoid breakage.
0.4.15
Fixes
- Correct usage of vec in specific feature combinations (@quodlibetor)
0.4.14 YANKED
Features
- Add day and week iterators for
NaiveDate(@gnzlbg & @robyoung) - Add a
Monthenum (@hhamana) - Add
locales. All format functions can now use locales, see the documentation for theunstable-localesfeature. - Fix
Local.from_local_datetimemethod for wasm
Improvements
- Added MIN and MAX values for
NaiveTime,NaiveDateTimeandDateTime<Utc>.
0.4.13
Features
- Add
DurationRoundtrait that allows rounding and truncating byDuration(@robyoung)
Internal Improvements
- Code improvements to impl
Fromforjs_sysin wasm to reuse code (@schrieveslaach)
0.4.12
New Methods and impls
Duration::absto ensure that a duration is just a magnitude (#418 @abreis).
Compatibility improvements
- impl
Fromforjs_sysin wasm (#424 @schrieveslaach) - Bump required version of
timefor redox support.
Bugfixes
- serde modules do a better job with
Optiontypes (#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)
0.4.11
Improvements
- Support a space or
TinFromStrforDateTime<Tz>, meaning that e.g.dt.to_string().parse::<DateTime<Utc>>()now correctly works on round-trip. (@quodlibetor in #378) - Support "negative UTC" in
parse_from_rfc2822(@quodlibetor #368 reported in #102) - Support comparisons of DateTimes with different timezones (@dlalic in #375)
- Many documentation improvements
Bitrot and external integration fixes
- Don't use wasmbind on wasi (@coolreader18 #365)
- Avoid deprecation warnings for
Error::description(@AnderEnder and @quodlibetor #376)
Internal improvements
- Use Criterion for benchmarks (@quodlibetor)
0.4.10
Compatibility notes
- Putting some functionality behind an
allocfeature to improve no-std support (in #341) means that if you were relying on chrono withno-default-featuresand using any of the functions that require alloc support (i.e. any of the string-generating functions liketo_rfc3339) you will need to add theallocfeature in your Cargo.toml.
Improvements
DateTime::parse_from_stris more than 2x faster in some cases. (@michalsrb #358)- Significant improvements to no-std and alloc support (This should also make many format/serialization operations induce zero unnecessary allocations) (@CryZe #341)
Features
- Functions that were accepting
IteratorofItems (for exampleformat_with_items) now acceptIteratorofBorrow<Item>, so one can use values or references. (@michalsrb #358) - Add built-in support for structs with nested
Option<Datetime>etc fields (@manifest #302)
Internal/doc improvements
- Use markdown footnotes on the
strftimedocs page (@qudlibetor #359) - Migrate from
try!->?(question mark) because it is now emitting deprecation warnings and has been stable since rustc 1.13.0 - Deny dead code
0.4.9
Fixes
- Make Datetime arithmatic adjust their offsets after discovering their new timestamps (@quodlibetor #337)
- Put wasm-bindgen related code and dependencies behind a
wasmbindfeature gate. (@quodlibetor #335)
0.4.8
Fixes
- Add '0' to single-digit days in rfc2822 date format (@wyhaya #323)
- Correctly pad DelayedFormat (@SamokhinIlya #320)
Features
- Support
wasm-unknown-unknownvia wasm-bindgen (in addition to emscripten/wasm-unknown-emscripten). (finished by @evq in #331, initial work by @jjpe #287)
0.4.7
Fixes
- Disable libc default features so that CI continues to work on rust 1.13
- Fix panic on negative inputs to timestamp_millis (@cmars #292)
- Make
LocalResultCopy/Eq/Hash
Features
- Add
std::convert::Fromconversions between the different timezone formats (@mqudsi #271) - Add
timestamp_nanosmethods (@jean-airoldie #308) - Documentation improvements
0.4.6
Maintenance
- Doc improvements -- improve README CI verification, external links
- winapi upgrade to 0.3
Unreleased
Features
- Added
NaiveDate::from_weekday_of_month{,_opt}for getting eg. the 2nd Friday of March 2017.
0.4.5
Features
- Added several more serde deserialization helpers (@novacrazy #258)
- Enabled all features on the playground (@davidtwco #267)
- Derive
HashonFixedOffset(@LuoZijun #254) - Improved docs (@storyfeet #261, @quodlibetor #252)
0.4.4
Features
- Added support for parsing nanoseconds without the leading dot (@emschwartz #251)
0.4.3
Features
- Added methods to DateTime/NaiveDateTime to present the stored value as a number of nanoseconds since the UNIX epoch (@harkonenbade #247)
- Added a serde serialise/deserialise module for nanosecond timestamps. (@harkonenbade #247)
- Added "Permissive" timezone parsing which allows a numeric timezone to be specified without minutes. (@quodlibetor #242)
0.4.2
Deprecations
- More strongly deprecate RustcSerialize: remove it from documentation unless the feature is enabled, issue a deprecation warning if the rustc-serialize feature is enabled (@quodlibetor #174)
Features
- Move all uses of the system clock behind a
clockfeature, for use in environments where we don't have access to the current time. (@jethrogb #236) - Implement subtraction of two
Dates,Times, orDateTimes, returning aDuration(@tobz1000 #237)
0.4.1
Bug Fixes
- Allow parsing timestamps with subsecond precision (@jonasbb)
- RFC2822 allows times to not include the second (@upsuper)
Features
- New
timestamp_millismethod onDateTimeandNaiveDateTimthat returns number of milliseconds since the epoch. (@quodlibetor) - Support exact decimal width on subsecond display for RFC3339 via a new
to_rfc3339_optsmethod onDateTime(@dekellum) - Use no_std-compatible num dependencies (@cuviper)
- Add
SubsecRoundtrait that allows rounding to the nearest second (@dekellum)
Code Hygiene and Docs
- Docs! (@alatiera @kosta @quodlibetor @kennytm)
- Run clippy and various fixes (@quodlibetor)
0.4.0 (2017-06-22)
This was originally planned as a minor release but was pushed to a major release due to the compatibility concern raised.
Added
-
IsoWeekhas been added for the ISO week without time zone. -
The
+=and-=operators againsttime::Durationare now supported forNaiveDate,NaiveTimeandNaiveDateTime. (#99)(Note that this does not invalidate the eventual deprecation of
time::Duration.) -
SystemTimeandDateTime<Tz>types can be now converted to each other viaFrom. Due to the obvious lack of time zone information inSystemTime, the forward direction is limited toDateTime<Utc>andDateTime<Local>only.
Changed
-
Intermediate implementation modules have been flattened (#161), and
UTChas been renamed toUtcin accordance with the current convention (#148).The full list of changes is as follows:
Before After chrono::date::Datechrono::Datechrono::date::MINchrono::MIN_DATEchrono::date::MAXchrono::MAX_DATEchrono::datetime::DateTimechrono::DateTimechrono::naive::time::NaiveTimechrono::naive::NaiveTimechrono::naive::date::NaiveDatechrono::naive::NaiveDatechrono::naive::date::MINchrono::naive::MIN_DATEchrono::naive::date::MAXchrono::naive::MAX_DATEchrono::naive::datetime::NaiveDateTimechrono::naive::NaiveDateTimechrono::offset::utc::UTCchrono::offset::Utcchrono::offset::fixed::FixedOffsetchrono::offset::FixedOffsetchrono::offset::local::Localchrono::offset::Localchrono::format::parsed::Parsedchrono::format::ParsedWith an exception of
Utc, this change does not affect any direct usage ofchrono::*orchrono::prelude::*types. -
Datelike::isoweekdateis replaced byDatelike::iso_weekwhich 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::weekdaymethod 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. -
NaiveDateTimeandDateTimecan 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::serdeandchrono::naive::serdemodules have been added for the serialization utilities. (#125)Currently they contain the
ts_secondsmodules that can be used to serializeNaiveDateTimeandDateTimevalues into an integral UNIX timestamp. This can be combined with Serde's[de]serialize_withattributes to fully support the (de)serialization to/from the timestamp.For rustc-serialize, there are separate
chrono::TsSecondsandchrono::naive::TsSecondstypes that are newtype wrappers implementing different (de)serialization logics. This is a suboptimal API, however, and it is strongly recommended to migrate to Serde.
Fixed
-
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)
0.3.1 (2017-05-02)
Added
-
Weekdaynow implementsFromStr,SerializeandDeserialize. (#113)The syntax is identical to
%A, i.e. either the shortest or the longest form of English names.
Changed
-
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.
Fixed
- Fixed a bug that the leap second can be mapped wrongly in the local time zone. Only occurs when the local time zone is behind UTC. (#130)
0.3.0 (2017-02-07)
The project has moved to the Chronotope organization.
Added
-
chrono::preludemodule has been added. All other glob imports are now discouraged. -
FixedOffsetcan be added to or subtracted from any timelike types.FixedOffset::local_minus_utcandFixedOffset::utc_minus_localmethods have been added. Note that the oldOffset::local_minus_utcmethod 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
Parsedtype have been slightly adjusted so that they can be internally extended without breaking any compatibility. -
Weekdayis nowHashable. (#109) -
ParseErrornow implementsEqas well asPartialEq. (#114) -
More documentation improvements. (#101, #108, #112)
Changed
-
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::Debugtextual 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_utcis nowOffset::fix, and returnsFixedOffsetinstead of a duration.This makes every time zone operation operate within a bias less than one day, and vastly simplifies many logics.
-
chrono::format::formatnow receivesFixedOffsetinstead oftime::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::Durationin the future.-
checked_*→checked_*_signedinDate,DateTime,NaiveDateandNaiveDateTimetypes -
overflowing_*→overflowing_*_signedin theNaiveTimetype -
All subtraction implementations between two time instants have been moved to
signed_duration_since, following the naming instd::time.
-
Fixed
- Fixed a panic when the
Localoffset receives a leap second. (#123)
Removed
-
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 forchrono::format::Pad. -
chrono::offset::add_with_leapsecondhas been removed. Use a direct addition withFixedOffsetinstead.
0.2.25 (2016-08-04)
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.)
Added
- Serde 0.8 is now supported. 0.7 also remains supported. (#86)
Fixed
- The deserialization implementation for rustc-serialize now properly verifies the input. All serialization codes are also now thoroughly tested. (#42)
0.2.23 (2016-08-03)
Added
-
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)
Fixed
-
When the system time records a leap second, the nanosecond component was mistakenly reset to zero. (#84)
-
Localoffset misbehaves in Windows for August and later, due to the long-standing libtime bug (dates back to mid-2015). Workaround has been implemented. (#85)
0.2.22 (2016-04-22)
Fixed
%.6fand%.9fused to print only three digits when the nanosecond part is zero. (#71)- The documentation for
%+has been updated to reflect the current status. (#71)
0.2.21 (2016-03-29)
Fixed
Fixed::LongWeekdayNamewas unable to recognize"sunday"(whoops). (#66)
0.2.20 (2016-03-06)
Changed
serdedependency has been updated to 0.7. (#63, #64)
0.2.19 (2016-02-05)
Added
- The documentation for
Dateis made clear about its ambiguity and guarantees.
Fixed
DateTime::datehad been wrong when the local date and the UTC date is in disagreement. (#61)
0.2.18 (2016-01-23)
Fixed
- Chrono no longer pulls a superfluous
randdependency. (#57)
0.2.17 (2015-11-22)
Added
- Naive date and time types and
DateTimenow have aserdesupport. They serialize as an ISO 8601 / RFC 3339 string just likeDebug. (#51)
0.2.16 (2015-09-06)
Added
- Added
%.3f,%.6fand%.9fspecifier 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)
Changed
- Forbade unsized types from implementing
DatelikeandTimelike. 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)
Fixed
- Fixed a broken link in the
README.md. (#41)
0.2.15 (2015-07-05)
Added
-
Padding modifiers
%_?,%-?and%0?are implemented. They are glibc extensions which seem to be reasonably widespread (e.g. Ruby). -
Added
%:zspecifier and corresponding formatting items which is essentially the same as%zbut with a colon. -
Added a new specifier
%.fwhich precision adapts from the input. This was added as a response to the UX problems in the original nanosecond specifier%f.
Fixed
-
Numeric::Timestampspecifier (%s) was ignoring the time zone offset when provided. -
Improved the documentation and associated tests for
strftime.
0.2.14 (2015-05-15)
Fixed
NaiveDateTime +/- DurationorNaiveTime +/- Durationcould have gone wrong when theDurationto be added is negative and has a fractional second part. This was caused by an underflow in the conversion fromDurationto the parts; the lack of tests for this case allowed a bug. (#37)
0.2.13 (2015-04-29)
Added
- The optional dependency on
rustc_serializeand relevantRustc{En,De}codableimplementations for supported types has been added. This is enabled by therustc-serializeCargo feature. (#34)
Changed
chrono::Durationreexport is changed to that of crates.iotimecrate. This enables Rust 1.0 beta compatibility.
0.2.4 (2015-03-03)
Fixed
- Clarified the meaning of
Date<Tz>and fixed unwanted conversion problem that only occurs with positive UTC offsets. (#27)
0.2.3 (2015-02-27)
Added
DateTime<Tz>andDate<Tz>is nowCopy/SendwhenTz::OffsetisCopy/Send. The implementations for them were mistakenly omitted. (#25)
Fixed
Local::from_utc_datetimedidn't set a correct offset. (#26)
0.2.1 (2015-02-21)
Changed
DelayedFormatno longer conveys a redundant lifetime.
0.2.0 (2015-02-19)
Added
-
Offsetis splitted intoTimeZone(constructor) andOffset(storage) types. You would normally see only the former, as the latter is mostly an implementation detail. Most importantly,Localnow can be used to directly construct timezone-aware values.Some types (currently,
UTCandFixedOffset) are bothTimeZoneandOffset, but others aren't (e.g.Localis not what is being stored to eachDateTimevalues). -
LocalResult::mapconvenience method has been added. -
TimeZonenow allows a construction ofDateTimevalues from UNIX timestamp, viatimestampandtimestamp_optmethods. -
TimeZonenow also has a method for parsingDateTime, namelydatetime_from_str. -
The following methods have been added to all date and time types:
checked_addchecked_subformat_with_items
-
The following methods have been added to all timezone-aware types:
timezonewith_timezonenaive_utcnaive_local
-
parse_from_strmethod has been added to all naive types andDateTime<FixedOffset>. -
All naive types and instances of
DateTimewith time zonesUTC,LocalandFixedOffsetimplement theFromStrtrait. They parse whatstd::fmt::Debugwould print. -
chrono::formathas been greatly rewritten.-
The formatting syntax parser is modular now, available at
chrono::format::strftime. -
The parser and resolution algorithm is also modular, the former is available at
chrono::format::parsewhile the latter is available atchrono::format::parsed. -
Explicit support for RFC 2822 and 3339 syntaxes is landed.
-
There is a minor formatting difference with atypical values, e.g. for years not between 1 BCE and 9999 CE.
-
Changed
-
Most uses of
Offsetare converted toTimeZone. In fact, all user-facing code is expected to beOffset-free. -
[Naive]DateTime::*num_seconds_from_unix_epoch*methods have been renamed to simplytimestamporfrom_timestamp*. The original names have been deprecated.
Removed
-
Timehas been removed. This also prompts a related set of methods inTimeZone.This is in principle possible, but in practice has seen a little use because it can only be meaningfully constructed via an existing
DateTimevalue. This made many operations toTimeunintuitive or ambiguous, so we simply let it go.In the case that
Timeis really required, one can use a simplerNaiveTime.NaiveTimeandNaiveDatecan be freely combined and splitted, andTimeZone::from_{local,utc}_datetimecan be used to convert from/to the local time. -
with_offsetmethod has been removed. Usewith_timezonemethod instead. (This is not deprecated since it is an integral part of offset reform.)
0.1.14 (2015-01-10)
Added
- Added a missing
std::fmt::Stringimpl forLocal.
0.1.13 (2015-01-10)
Changed
- Most types now implement both
std::fmt::Showandstd::fmt::String, with the former used for the stricter output and the latter used for more casual output.
Removed
Offset::namehas been replaced by astd::fmt::Stringimplementation toOffset.
0.1.12 (2015-01-08)
Removed
Duration + Tno longer works due to the updated impl reachability rules. UseT + Durationas a workaround.
0.1.4 (2014-12-13)
Fixed
- Fixed a bug that
Date::and_*methods with an offset that can change the date are off by one day.
0.1.3 (2014-11-28)
Added
-
{Date,Time,DateTime}::with_offsetmethods have been added. -
LocalResultnow implements a common set of traits. -
LocalResult::and_*methods have been added. They are useful for safely chainingLocalResult<Date<Off>>methods to makeLocalResult<DateTime<Off>>.
Changed
-
Offset::namenow returnsSendStr. -
{Date,Time} - Durationoverloadings are now allowed.
0.1.2 (2014-11-24)
Added
Duration + Dateoverloading is now allowed.
Changed
- Chrono no longer needs
numdependency.
0.1.0 (2014-11-20)
The initial version that was available to crates.io.