Skip to content

Releases: chronotope/chrono

v0.4.10

05 Sep 11:53
5905935
Compare
Choose a tag to compare

Compatibility notes

  • Putting some functionality behind an 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.

Improvements

  • DateTime::parse_from_str is 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 Iterator of Items (for example format_with_items) now accept Iterator of Borrow<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 strftime docs 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

v0.4.9

05 Sep 11:53
bbfcfad
Compare
Choose a tag to compare

Fixes

  • Make Datetime arithmatic adjust their offsets after discovering their new timestamps (@quodlibetor #337)
  • Put wasm-bindgen related code and dependencies behind a wasmbind feature gate. (@quodlibetor #335)

v0.4.7

05 Sep 11:57
Compare
Choose a tag to compare

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 LocalResult Copy/Eq/Hash

Features

  • Add std::convert::From conversions between the different timezone formats (@mqudsi #271)
  • Add timestamp_nanos methods (@jean-airoldie #308)
  • Documentation improvements

v0.4.6

05 Sep 11:57
Compare
Choose a tag to compare

Maintenance

  • Doc improvements -- improve README CI verification, external links
  • winapi upgrade to 0.3

Features

  • Added NaiveDate::from_weekday_of_month{,_opt} for getting eg. the 2nd Friday of March 2017.

v0.4.5

05 Sep 11:57
Compare
Choose a tag to compare

Features

v0.4.4

05 Sep 11:58
Compare
Choose a tag to compare

Features

  • Added support for parsing nanoseconds without the leading dot (@emschwartz #251)

v0.4.3

05 Sep 11:58
Compare
Choose a tag to compare

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)

v0.4.2

05 Sep 11:59
Compare
Choose a tag to compare

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 clock feature, for use in environments where we don't have access to the current time. (@jethrogb #236)
  • Implement subtraction of two Dates, Times, or DateTimes, returning a Duration (@tobz1000 #237)

v0.4.1

05 Sep 11:59
ee52f2f
Compare
Choose a tag to compare

Bug Fixes

  • Allow parsing timestamps with subsecond precision (@jonasbb)
  • RFC2822 allows times to not include the second (@upsuper)

Features

  • New timestamp_millis method on DateTime and NaiveDateTim that returns number of milliseconds since the epoch. (@quodlibetor)
  • Support exact decimal width on subsecond display for RFC3339 via a new to_rfc3339_opts method on DateTime (@dekellum)
  • Use no_std-compatible num dependencies (@cuviper)
  • Add SubsecRound trait that allows rounding to the nearest second (@dekellum)

v0.4.0

05 Sep 12:02
fe529c8
Compare
Choose a tag to compare

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.
  • The documentation has been streamlined by removing intermediate implementation modules and accounting for several minor but essential suggestions.

This was originally planned as a minor release but was pushed to a major release due to the compatibility concern raised.

Added

  • 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.

Changed

  • 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.

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)