nt-time is a Windows NT system time library for Rust.
Add this to your Cargo.toml
:
toml
[dependencies]
nt-time = "0.3.0"
```rust use core::time::Duration;
use nt_time::{time::OffsetDateTime, FileTime};
let ft = FileTime::NTEPOCH; asserteq!( OffsetDateTime::tryfrom(ft).unwrap().tostring(), "1601-01-01 0:00:00.0 +00:00:00" );
let ft = ft + Duration::fromsecs(11644473600); asserteq!( OffsetDateTime::tryfrom(ft).unwrap(), OffsetDateTime::UNIXEPOCH ); asserteq!(ft.asu64(), 116444736000000000);
assert_eq!(FileTime::new(u64::MAX), FileTime::MAX); ```
std
Enables features that depend on the standard library. This is enabled by default.
large-dates
Enables the large-dates
feature of the time
crate.
chrono
Enables the chrono
crate.
serde
Enables the serde
crate.
serde-human-readable
Allows Serde representations to use a human-readable format.
This implicitly enables the serde
feature.
If this feature is not enabled, the underlying 64-bit unsigned integer format
will be used.
no_std
supportThis supports no_std
mode.
Disables the default
feature to enable this.
See the documentation for more details.
The minimum supported Rust version (MSRV) of this library is v1.63.0.
Please see CHANGELOG.adoc.
Please see CONTRIBUTING.adoc.
Copyright © 2023 Shun Sakai (see AUTHORS.adoc)
This library is distributed under the terms of either the Apache License 2.0 or the MIT License.
See COPYRIGHT, LICENSE-APACHE and LICENSE-MIT for more details.