[][src]Module melib::datetime

Functions for dealing with date strings and UNIX Epoch timestamps.

Examples

// Get current UNIX Epoch timestamp.
let now: UnixTimestamp = now();

// Parse date from string
let date_val = "Wed, 8 Jan 2020 10:44:03 -0800";
let timestamp = rfc822_to_timestamp(date_val).unwrap();
assert_eq!(timestamp, 1578509043);

// Convert timestamp back to string
let s = timestamp_to_string(timestamp, Some("%Y-%m-%d"));
assert_eq!(s, "2020-01-08");

Constants

TIMEZONE_ABBR

Functions

gettimeofday
localtime_r
mktime
month_to_secs
now
rfc822_to_timestamp
rfc3339_to_timestamp
strftime
strptime
timestamp_from_string
timestamp_to_string
tm_to_secs
year_to_secs

Type Definitions

UnixTimestamp