thetime

Crates.iothetime
lib.rsthetime
version0.5.6
sourcesrc
created_at2024-01-03 08:45:15.658372
updated_at2024-01-08 09:16:43.578144
descriptionA simple but powerful Rust library for dealing with the time, both NTP and System. Contains wrappers for functions often buried in modules. Has extensive support for unusual epochs (Windows LDAP 100ns, MacOS and MacOS CFA, SAS 4GL, WebKit and Chromium 1μs). Supports timezone conversion, and addition/subtraction of various amounts
homepage
repositoryhttps://github.com/werdl/thetime
max_upload_size
id1087220
size61,441
werdl (werdl)

documentation

https://docs.rs/thetime

README

thetime

GitHub Actions crates.io thetime on docs.rs

Simple Rust library for time

  • builds on top of std (almost exclusively core), chrono and time
  • very simple and intuitive to use
  • wraps some very useful functions that are usually buried deep in modules
  • has extensive support for unusual epochs
  • Fully supports without overflow, as the core data is stored as u64s, times since 01-01-1601, and up to, in my testing, "a+262143-01-01

Features

ntp

  • Default: true
  • includes: Ntp struct

Which traits you need

// Basic functionality
use thetime::{System, Ntp, Time};

// Diff functions
use thetime::{System, Ntp, Time, TimeDiff};

// String direct strptime
use thetime::{System, Ntp, Time, StrTime};

// Timestamp int conversion
use thetime::{System, Ntp, Time, IntTime}

// Timezones
use thetime::Tz;

Utilities provided

List

  • NTP server pinging
  • System time grabbing
  • time diff functions
  • string to time structs
  • timestamps as integers to time structs
  • strptime and strftime
  • convienent now method in the root for easy access
  • various epochs
  • 01-01-1904 (MacOS)
  • 01-01-2001 (MacOS Absolute)
  • 01-01-1601 (Windows, measured in 100ns chunks)
  • 01-01-1960 (SAS 4GL)
  • 01-01-1601 (Webkit, measured in μs)
Commit count: 0

cargo fmt