Chrono: Timezone-aware date and time handling
Chrono aims to provide all functionality needed to do correct operations on dates and times in the proleptic Gregorian calendar:
DateTimetype is timezone-aware by default, with separate timezone-naive types.
- Operations that may produce an invalid or ambiguous date and time return
- Configurable parsing and formatting with an
strftimeinspired date and time formatting syntax.
Localtimezone works with the current timezone of the OS.
- Types and operations are implemented to be reasonably efficient.
Timezone data is not shipped with chrono by default to limit binary sizes. Use the companion crate
full timezone support.
See docs.rs for the API reference.
- Only the proleptic Gregorian calendar (i.e. extended to support older dates) is supported.
- Date types are limited to about +/- 262,000 years from the common epoch.
- Time types are limited to nanosecond accuracy.
- Leap seconds can be represented, but Chrono does not fully support them. See Leap Second Handling.
alloc: Enable features that depend on allocation (primarily string formatting)
std: Enables functionality that depends on the standard library. This is a superset of
allocand adds interoperation with standard library types and traits.
clock: Enables reading the system time (
now) and local timezone (
wasmbind: Interface with the JS Date API for the
serde: Enable serialization/deserialization via serde.
rkyv: Enable serialization/deserialization via rkyv.
rustc-serialize: Enable serialization/deserialization via rustc-serialize (deprecated).
old_time: compatability with the
Durationtype of the
time0.1 crate (deprecated).
arbitrary: construct arbitrary instances of a type with the Arbitrary crate.
unstable-locales: Enable localization. This adds various methods with a
_localizedsuffix. The implementation and API may change or even be removed in a patch release. Feedback welcome.
Rust version requirements
The Minimum Supported Rust Version (MSRV) is currently Rust 1.56.0.
The MSRV is explicitly tested in CI. It may be bumped in minor releases, but this is not done lightly.
This project is licensed under either of
at your option.