Crate time_util[][src]

Expand description

A crate for more or less frequently used time parsing and formatting functionality.

The crate revolves around the std::time::SystemTime type in that we attempt to convert into that or use this as the base to convert from. We treat such a time as having no associated time zone. Think of it as being in UTC.

Functions

days_back
days_back_from
next_day

Calculate the time stamp representing the next day of the given time stamp.

optional_system_time_from_str

Deserialize an optional time stamp.

optional_system_time_to_rfc3339

Serialize an optional SystemTime into a RFC3339 time stamp.

optional_system_time_to_rfc3339_with_nanos

Serialize an optional SystemTime into a RFC3339 time stamp.

parse_system_time_from_date_str

Parse a SystemTime from a date string.

parse_system_time_from_str

Parse a SystemTime from a string.

print_system_time_to_iso8601_date

Print a SystemTime as a RFC3339 time stamp.

print_system_time_to_rfc3339

Print a SystemTime as a RFC3339 time stamp.

print_system_time_to_rfc3339_with_nanos

Print a SystemTime as a RFC3339 time stamp.

system_time_from_date_str

Deserialize a SystemTime from a date.

system_time_from_millis

Deserialize a SystemTime from a timestamp containing the milliseconds since 1970-01-01.

system_time_from_millis_in_new_york

Deserialize a SystemTime from a timestamp containing the milliseconds since 1970-01-01 in the New York time zone.

system_time_from_secs

Deserialize a SystemTime from a UNIX time stamp.

system_time_from_str

Deserialize a time stamp as a SystemTime.

system_time_to_millis

Serialize a SystemTime into a timestamp containing the milliseconds since 1970-01-01.

system_time_to_millis_in_new_york

Serialize a SystemTime into a timestamp containing the milliseconds since 1970-01-01 in New York.

system_time_to_rfc3339

Serialize a SystemTime into a RFC3339 time stamp.

system_time_to_rfc3339_with_nanos

Serialize a SystemTime into a RFC3339 time stamp.

tomorrow

Calculate a SystemTime representing 0:00:00 (i.e., the first second of) the next day.