Enable tests that depend on bincode

The bincode crate was imported in b/330683225, so we can now enable unit tests for crates which uses it as a dev-dependency.

Bug: 333560480
Flag: TEST_ONLY
Test: atest --host 'chrono_test_*'
Change-Id: Iad7500e927ad276578bb010eb8542e5533915168
2 files changed
tree: 5da872d46a1e7a00ed4b39bff28fa89c4d4fe1f2
  1. .github/
  2. src/
  3. tests/
  4. .cargo_vcs_info.json
  5. .git-ignore-revs
  6. .gitignore
  7. Android.bp
  8. appveyor.yml
  9. Cargo.toml
  10. Cargo.toml.orig
  11. cargo_embargo.json
  12. CHANGELOG.md
  13. CITATION.cff
  14. deny.toml
  15. LICENSE.txt
  16. METADATA
  17. MODULE_LICENSE_APACHE2
  18. OWNERS
  19. README.md
  20. rustfmt.toml
  21. taplo.toml
  22. TEST_MAPPING
README.md

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 LocalResult.
  • 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: Enable serialization/deserialization via rkyv.
  • rustc-serialize: Enable serialization/deserialization via rustc-serialize (deprecated).
  • 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.

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.