time-format

This crate does only one thing: format a Unix timestamp.

Splitting a timestamp into its components

The components_utc() function returns the components of a timestamp:

```rust let ts = std::time::SystemTime::now() .durationsince(std::time::UNIXEPOCH).unwrap().as_secs();

let components = timeformat::componentsutc(ts).unwrap(); ```

Components are sec, min, hour, month_day, month, year, week_day and year_day.

Formatting a timestamp

The strftime_utc() function formats a timestamp, using the same format as the strftime() function of the standard C library.

```rust let ts = std::time::SystemTime::now() .durationsince(std::time::UNIXEPOCH).unwrap().as_secs();

let s = timeformat::strftimeutc("%Y-%m-%d", ts).unwrap(); ```

That's it

If you need a minimal crate to get timestamps and perform basic operations on them, check out coarsetime.

coarsetime fully supports WebAssembly, in browsers and WASI environments.