Docs.rs
  • unix-ts-macros-0.4.0
    • unix-ts-macros 0.4.0
    • Docs.rs crate page
    • MIT
    • Links
    • Homepage
    • Repository
    • crates.io
    • Source
    • Owners
    • lukesneeringer
    • Dependencies
      • unix-ts ^0.4.0 dev
      • readme-rustdocifier ^0.1 build
    • Versions
    • 100% of the crate is documented
  • Go to latest version
  • Platform
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation
logo

Crate unix_ts_macros

logo

Crate unix_ts_macros

  • Version 0.4.0
  • All Items
  • Macros

Macros

  • ts
logo
Change settings

Crate unix_ts_macros

source · [−]
Expand description

unix-ts-macros simplifies the creation of timestamps into a procedural macro: ts. This is an implementation crate for unix-ts, which is what you should actually add as a dependency.

Usage

Add the unix-ts crate to your Cargo.toml file like usual:

[dependencies]
unix-ts = "0.2"

You can create a timestamp with the ts! macro, which takes the Unix timestamp as an argument:

use unix_ts_macros::ts;

// The argument is the number of seconds since the Unix epoch.
let t = ts!(1335020400);

// Fractional seconds are also allowed.
let t2 = ts!(1335020400.25);

Macros

ts

Create a timestamp from the given Unix timestamp.

Results for rs

unix_ts_macros::ts
Create a timestamp from the given Unix timestamp.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.