chrono

Date and time library for Rust

Latest version: 0.4.38 registry icon
Maintenance score
100
Safety score
93
Popularity score
89
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
0.4.38 0 0 0 0 0
0.4.37 0 0 0 0 0
0.4.36 0 0 0 0 0
0.4.35 0 0 0 0 0
0.4.34 0 0 0 0 0
0.4.33 0 0 0 0 0
0.4.32 0 0 0 0 0
0.4.31 0 0 0 0 0
0.4.30 0 0 0 0 0
0.4.29 0 0 0 0 0
0.4.28 0 0 0 0 0
0.4.27 0 0 0 0 0
0.4.26 0 0 0 0 0
0.4.25 0 0 0 0 0
0.4.24 0 0 0 0 0
0.4.23 0 0 0 0 0
0.4.22 0 0 0 0 0
0.4.21 0 0 0 0 0
0.4.20 0 0 0 0 0
0.4.19 0 0 1 0 0
0.4.18 0 0 1 0 0
0.4.17 0 0 1 0 0
0.4.16 0 0 1 0 0
0.4.15 0 0 1 0 0
0.4.14 0 0 1 0 0
0.4.13 0 0 1 0 0
0.4.12 0 0 1 0 0
0.4.11 0 0 1 0 0
0.4.10 0 0 1 0 0
0.4.9 0 0 1 0 0
0.4.8 0 0 1 0 0
0.4.7 0 0 1 0 0
0.4.6 0 0 1 0 0
0.4.5 0 0 1 0 0
0.4.4 0 0 1 0 0
0.4.3 0 0 1 0 0
0.4.2 0 0 1 0 0
0.4.1 0 0 1 0 0
0.4.0 0 0 1 0 0
0.3.1 0 0 1 0 0
0.3.0 0 0 1 0 0
0.2.25 0 0 1 0 0
0.2.24 0 0 1 0 0
0.2.23 0 0 1 0 0
0.2.22 0 0 1 0 0
0.2.21 0 0 1 0 0
0.2.20 0 0 1 0 0
0.2.19 0 0 1 0 0
0.2.18 0 0 1 0 0
0.2.17 0 0 1 0 0
0.2.16 0 0 1 0 0
0.2.15 0 0 1 0 0
0.2.14 0 0 1 0 0
0.2.13 0 0 1 0 0
0.2.12 0 0 1 0 0
0.2.11 0 0 1 0 0
0.2.10 0 0 1 0 0
0.2.9 0 0 1 0 0
0.2.8 0 0 1 0 0
0.2.7 0 0 1 0 0
0.2.6 0 0 1 0 0
0.2.5 0 0 1 0 0
0.2.4 0 0 1 0 0
0.2.3 0 0 1 0 0
0.2.2 0 0 1 0 0
0.2.1 0 0 1 0 0
0.2.0 0 0 1 0 0
0.1.18 0 0 1 0 0
0.1.17 0 0 1 0 0
0.1.16 0 0 1 0 0
0.1.15 0 0 1 0 0
0.1.14 0 0 1 0 0
0.1.13 0 0 1 0 0
0.1.12 0 0 1 0 0
0.1.11 0 0 1 0 0
0.1.10 0 0 1 0 0
0.1.9 0 0 1 0 0
0.1.8 0 0 1 0 0
0.1.7 0 0 1 0 0
0.1.6 0 0 1 0 0
0.1.5 0 0 1 0 0
0.1.4 0 0 1 0 0
0.1.3 0 0 1 0 0
0.1.2 0 0 1 0 0
0.1.1 0 0 1 0 0
0.1.0 0 0 1 0 0

Stability
Latest release:

0.4.38 - This version is safe to use because it has no known security vulnerabilities at this time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

Apache-2.0   -   Apache License 2.0

Not a wildcard

Not proprietary

OSI Compliant


MIT   -   MIT License

Not a wildcard

Not proprietary

OSI Compliant



Chrono: Timezone-aware date and time handling

Chrono GitHub Actions Chrono on crates.io Chrono on docs.rs Chat codecov.io

Chrono aims to provide all functionality needed to do correct operations on dates and times in the proleptic Gregorian calendar:

  • The DateTime type is timezone-aware by default, with separate timezone-naive types.
  • Operations that may produce an invalid or ambiguous date and time return Option or MappedLocalTime.
  • Configurable parsing and formatting with an strftime inspired date and time formatting syntax.
  • The Local timezone 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 Chrono-TZ or tzfile for full timezone support.

Documentation

See docs.rs for the API reference.

Limitations

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

Crate features

Default features:

  • alloc: Enable features that depend on allocation (primarily string formatting).
  • std: Enables functionality that depends on the standard library. This is a superset of alloc and adds interoperation with standard library types and traits.
  • clock: Enables reading the local timezone (Local). This is a superset of now.
  • now: Enables reading the system time (now).
  • wasmbind: Interface with the JS Date API for the wasm32 target.

Optional features:

  • serde: Enable serialization/deserialization via serde.
  • rkyv: Deprecated, use the rkyv-* features.
  • rkyv-16: Enable serialization/deserialization via rkyv, using 16-bit integers for integral *size types.
  • rkyv-32: Enable serialization/deserialization via rkyv, using 32-bit integers for integral *size types.
  • rkyv-64: Enable serialization/deserialization via rkyv, using 64-bit integers for integral *size types.
  • rkyv-validation: Enable rkyv validation support using bytecheck.
  • arbitrary: Construct arbitrary instances of a type with the Arbitrary crate.
  • unstable-locales: Enable localization. This adds various methods with a _localized suffix. The implementation and API may change or even be removed in a patch release. Feedback welcome.
  • oldtime: This feature no longer has any effect; it used to offer compatibility with the time 0.1 crate.

Note: The rkyv{,-16,-32,-64} features are mutually exclusive.

Rust version requirements

The Minimum Supported Rust Version (MSRV) is currently Rust 1.61.0.

The MSRV is explicitly tested in CI. It may be bumped in minor releases, but this is not done lightly.

License

This project is licensed under either of

at your option.