nt-time is a Windows file time library for Rust.
Add this to your Cargo.toml
:
toml
[dependencies]
nt-time = "0.6.0"
```rust use core::time::Duration;
use nt_time::{ time::{macros::datetime, OffsetDateTime}, FileTime, };
let ft = FileTime::NTTIMEEPOCH; asserteq!( OffsetDateTime::tryfrom(ft).unwrap(), datetime!(1601-01-01 00:00 UTC) );
let ft = ft + Duration::fromsecs(11644473600); asserteq!( OffsetDateTime::tryfrom(ft).unwrap(), OffsetDateTime::UNIXEPOCH ); asserteq!(ft.toraw(), 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.
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.65.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 COPYING for more details.