Giter Site home page Giter Site logo

thetime's Introduction

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)

thetime's People

Contributors

werdl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.