windows-time (0.100.0+paring.1)

Published 2026-10-14 03:21:30 +09:00 by paring

Installation

[registries.forgejo]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add windows-time@0.100.0+paring.1 --registry forgejo

About this package

Windows time types

windows-time

The windows-time crate provides Windows TimeSpan and DateTime values with Rust constructors, arithmetic, and std::time conversions.

TimeSpan is a duration and DateTime is a point in time. Both use 100-nanosecond ticks.

Start by adding the following to your Cargo.toml file:

[dependencies.windows-time]
version = "0.100"

Use the time types as needed:

use windows_time::*;

let span = TimeSpan::from_minutes(90);
assert_eq!(span.whole_seconds(), 5400);

let start = DateTime::from_unix_secs(1_000_000_000);
let later = start.checked_add(span).unwrap();
assert_eq!(later.unix_secs(), 1_000_005_400);

Dependencies

ID Version
windows-core ^0.100.0
Details
Cargo
2026-10-14 03:21:30 +09:00
20
2026-11-10 00:22:51 +09:00
MIT OR Apache-2.0
12 KiB
Assets (1)
Versions (1) View all
0.100.0+paring.1 2026-10-14