프로젝트
GitHub에서 보기
chronotope/chrono
소개
Rust용 날짜 및 시간 라이브러리
생산성 및 자동화What you can do
- 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).
측정된 스타 증가
- in 24h
- +8
- in 7 days
- +46
- in 15 days
- +93
- in 1 month
- +120
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalChrono: 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:
- The
DateTimetype is timezone-aware by default, with separate timezone-naive types. - Operations that may produce an invalid or ambiguous date and time return
OptionorMappedLocalTime. - Configurable parsing and formatting with an
strftimeinspired date and time formatting syntax. - The
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
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 ofallocand adds interoperation with standard library types and traits.clock: Enables reading the local timezone (Local). This is a superset ofnow.now: Enables reading the system time (now).wasmbind: Interface with the JS Date API for thewasm32target.
Optional features:
serde: Enable serialization/deserialization via serde.rkyv: Deprecated, use therkyv-*features.rkyv-16: Enable serialization/deserialization via rkyv, using 16-bit integers for integral*sizetypes.rkyv-32: Enable serialization/deserialization via rkyv, using 32-bit integers for integral*sizetypes.rkyv-64: Enable serialization/deserialization via rkyv, using 64-bit integers for integral*sizetypes.rkyv-validation: Enable rkyv validation support usingbytecheck.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.oldtime: This feature no longer has any effect; it used to offer compatibility with thetime0.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.62.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.
관련 프로젝트 살펴보기
불러오는 중…