|0.2.0||Aug 3, 2022|
|0.1.4||Aug 3, 2022|
|0.1.3||Jul 25, 2022|
|0.0.0-pre5||Jul 24, 2022|
#73 in Date and time
1,560 downloads per month
Used in tzdb
This library solves one question, and one question only: What's the time?
let now = utcnow().unwrap(); let seconds = now.as_secs(); let nanos = now.subsec_nanos();
For many target platforms this call cannot fail.
If this is true for the current target, then the constant
INFALLIBLE will be
If the target platform is not supported, then
utcnow() will always return an error instead of failing to compile.
Use the library with
default-features = false and without the feature
fallback to get a compile-time error instead.
std (enabled by default) is only needed if you need the
Error type to implement
If you have successfully tested one of the untested targets, then please tell me. And if not, then even more so!
If you know how to implement another target, then please open a pull request.
Supported and tested:
- Linux with Musl
(Probably) supported, but not actually tested:
Increasing the msrv for tier-2 or lower platforms will not be indicated as a breaking change to the semver version.
utcnow has the following optional features:
serde, which implements
arbitrary, which implements the
arbitrary::Arbitrarytrait for using
proptest, which implements the
proptest::arbitrary::Arbitrarytrait for using
quickcheck, which implements the
quickcheck::Arbitrarytrait for using