[][src]Crate unisecs

Provides a way of representing unix time in terms of seconds with fractional subseconds.

Examples

The following is roughly equivalent with date -v+1S +%s

use std::time::Duration;
use unisecs::Seconds;

fn main() {
  println!(
    "{}",
    Seconds::now() + Duration::from_secs(5)
  );
}

Features

serde

Adds ability to serialize and deserialize seconds with serde. This is enabled by default. To turn if off add the following to your Cargo.toml file

[dependencies.unisecs]
 version = "..."
 default-features = false

Structs

Seconds

Represents fractional seconds since the unix epoch These can be derived from std::time::Duration and be converted into std::time::Duration