chrono

Date and time library for Rust

https://github.com/chronotope/chrono

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    6 of 247 committers (2.4%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.8%) to scientific vocabulary

Keywords

calendar date rust time

Keywords from Contributors

argument-parser command-line-parser parsed-arguments positional-arguments subcommands search-engine systemd system services init
Last synced: 6 months ago · JSON representation ·

Repository

Date and time library for Rust

Basic Info
  • Host: GitHub
  • Owner: chronotope
  • License: other
  • Language: Rust
  • Default Branch: main
  • Homepage:
  • Size: 4.64 MB
Statistics
  • Stars: 3,661
  • Watchers: 24
  • Forks: 588
  • Open Issues: 180
  • Releases: 0
Topics
calendar date rust time
Created almost 12 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Citation

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

Owner

  • Name: Chronotope
  • Login: chronotope
  • Kind: organization

Home for Chrono, a Rust date/time library

Citation (CITATION.cff)

# Parser settings.
cff-version: 1.2.0
message: Please cite this crate using these information.

# Version information.
date-released: 2025-02-26
version: 0.4.41

# Project information.
abstract: Date and time library for Rust
authors:
  - alias: quodlibetor
    family-names: Maister
    given-names: Brandon W.
  - alias: djc
    family-names: Ochtman
    given-names: Dirkjan
  - alias: lifthrasiir
    family-names: Seonghoon
    given-names: Kang
  - alias: esheppa
    family-names: Sheppard
    given-names: Eric
  - alias: pitdicker
    family-names: Dicker
    given-names: Paul
license:
  - Apache-2.0
  - MIT
repository-artifact: https://crates.io/crates/chrono
repository-code: https://github.com/chronotope/chrono
title: chrono
url: https://docs.rs/chrono

GitHub Events

Total
  • Create event: 25
  • Release event: 3
  • Issues event: 44
  • Watch event: 314
  • Delete event: 15
  • Issue comment event: 244
  • Push event: 48
  • Gollum event: 1
  • Pull request review comment event: 118
  • Pull request review event: 115
  • Pull request event: 116
  • Fork event: 60
Last Year
  • Create event: 25
  • Release event: 3
  • Issues event: 44
  • Watch event: 314
  • Delete event: 15
  • Issue comment event: 244
  • Push event: 48
  • Gollum event: 1
  • Pull request review comment event: 118
  • Pull request review event: 115
  • Pull request event: 116
  • Fork event: 60

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 1,554
  • Total Committers: 247
  • Avg Commits per committer: 6.291
  • Development Distribution Score (DDS): 0.674
Past Year
  • Commits: 68
  • Committers: 33
  • Avg Commits per committer: 2.061
  • Development Distribution Score (DDS): 0.588
Top Committers
Name Email Commits
Paul Dicker p****l@p****l 507
Kang Seonghoon p****t@m****g 204
Brandon W Maister q****r@g****m 166
Dirkjan Ochtman d****n@o****l 146
Eric Sheppard k****2@e****d 38
jtmoon79 8****9 27
Constantin Nickel c****l@g****m 15
David Kellum d****s@g****m 14
Rob Young r****b@r****l 10
eV ev@7****z 10
dependabot[bot] 4****] 9
Sergey Potapov b****3@g****m 7
Michal Srb m****b@g****m 7
Mahmoud Al-Qudsi m****i@n****t 7
Dídac Sementé Fernández d****e@g****m 7
Evan Schwartz e****z@g****m 6
Eunchong Yu k****e@g****m 6
Conrad Ludgate c****e@t****m 6
Ashley Mannix a****x@l****u 6
Dan Williams d****n@d****k 6
René Kijewski r****i@f****e 5
Milo 5****9 5
LingMan L****n 5
Yureka y****a@y****v 4
Thomas Bytheway t****3@c****k 4
ShadoySV s****v@y****u 4
Brennan Vincent b****n@u****m 4
Georges Goetz g****z@b****m 4
John Nagle n****e@s****m 4
János Illés i****s@g****m 4
and 217 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 280
  • Total pull requests: 738
  • Average time to close issues: over 1 year
  • Average time to close pull requests: about 2 months
  • Total issue authors: 220
  • Total pull request authors: 149
  • Average comments per issue: 4.58
  • Average comments per pull request: 3.16
  • Merged pull requests: 491
  • Bot issues: 0
  • Bot pull requests: 37
Past Year
  • Issues: 33
  • Pull requests: 138
  • Average time to close issues: 2 days
  • Average time to close pull requests: 3 days
  • Issue authors: 31
  • Pull request authors: 51
  • Average comments per issue: 1.33
  • Average comments per pull request: 1.81
  • Merged pull requests: 87
  • Bot issues: 0
  • Bot pull requests: 14
Top Authors
Issue Authors
  • pitdicker (28)
  • djc (8)
  • lifthrasiir (5)
  • MarcoGorelli (4)
  • Ekleog (3)
  • kornelski (3)
  • doivosevic (2)
  • Geobert (2)
  • AVee (2)
  • decathorpe (2)
  • frederikhors (2)
  • eval-exec (2)
  • and-reas-se (2)
  • MrFaul (2)
  • gdennie (2)
Pull Request Authors
  • pitdicker (357)
  • djc (56)
  • dependabot[bot] (37)
  • esheppa (21)
  • jtmoon79 (16)
  • Zomtir (15)
  • danwilliams (5)
  • francisbr (4)
  • erickt (4)
  • ggoetz (4)
  • ChrisDenton (4)
  • tugtugtug (4)
  • Awpteamoose (4)
  • tmccombs (3)
  • AVee (3)
Top Labels
Issue Labels
parsing (8) panic (7) API-incompatible (7) serde (7) formatting (4) wishlist (2) timezone (1) out-of-scope (1) meta (1) interoperability (1) error-handling (1) bug (1) documentation (1)
Pull Request Labels
dependencies (37) waiting-on-review (35) rust (28) github_actions (9) API-incompatible (6) waiting-on-author (5) serde (3)

Packages

  • Total packages: 3
  • Total downloads:
    • cargo 348,098,529 total
  • Total docker downloads: 45,527,829
  • Total dependent packages: 11,377
    (may contain duplicates)
  • Total dependent repositories: 44,593
    (may contain duplicates)
  • Total versions: 94
  • Total maintainers: 2
  • Total advisories: 1
crates.io: chrono

Date and time library for Rust

  • Versions: 91
  • Dependent Packages: 11,374
  • Dependent Repositories: 44,592
  • Downloads: 348,090,715 Total
  • Docker Downloads: 45,527,829
Rankings
Dependent packages count: 0.0%
Downloads: 0.0%
Docker downloads count: 0.1%
Dependent repos count: 0.1%
Average: 0.7%
Forks count: 1.8%
Stargazers count: 2.4%
Maintainers (1)
Last synced: 6 months ago
crates.io: chrono-wasi

Date and time library for Rust

  • Versions: 2
  • Dependent Packages: 2
  • Dependent Repositories: 1
  • Downloads: 5,149 Total
Rankings
Forks count: 1.8%
Stargazers count: 2.5%
Dependent packages count: 12.2%
Average: 12.8%
Dependent repos count: 16.5%
Downloads: 31.2%
Maintainers (1)
Last synced: 6 months ago
crates.io: chrono-wasi07

Date and time library for Rust

  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 2,665 Total
Rankings
Forks count: 2.0%
Stargazers count: 2.8%
Dependent packages count: 17.0%
Average: 19.9%
Dependent repos count: 29.3%
Downloads: 48.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/lint.yml actions
  • EmbarkStudios/cargo-deny-action v1 composite
  • Swatinem/rust-cache v2 composite
  • actions/checkout v3 composite
  • dtolnay/rust-toolchain stable composite
.github/workflows/test.yml actions
  • Swatinem/rust-cache v2 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • dtolnay/rust-toolchain master composite
  • dtolnay/rust-toolchain stable composite
  • dtolnay/rust-toolchain nightly composite
  • taiki-e/install-action cargo-hack composite
Cargo.toml cargo
  • bincode 1.3.0 development
  • doc-comment 0.3 development
  • num-iter 0.1.35 development
  • serde_derive 1 development
  • serde_json 1 development
  • arbitrary 1.0.0
  • criterion 0.4.0
  • iana-time-zone 0.1.45
  • num-integer 0.1.36
  • pure-rust-locales 0.5.2
  • rkyv 0.7
  • serde 1.0.99
.github/workflows/codecov.yml actions
  • actions/checkout v4 composite
  • codecov/codecov-action v3 composite
  • taiki-e/install-action cargo-llvm-cov composite
bench/Cargo.toml cargo
  • criterion 0.5.0 development
  • serde_json 1 development
ci/core-test/Cargo.toml cargo
fuzz/Cargo.toml cargo