Crate humantime [] [src]

Human-friendly time parser and formatter

Features:

Timestamp parsing/formatting is super-fast because format is basically fixed.

See serde-humantime for serde integration.

Structs

Duration

A wrapper for duration that has FromStr implementation

FormattedDuration

A wrapper type that allows you to Display a Duration

Rfc3339Timestamp

A wrapper type that allows you to Display a SystemTime

Timestamp

A wrapper for SystemTime that has FromStr implementation

Enums

DurationError

Error parsing human-friendly duration

TimestampError

Error parsing datetime (timestamp)

Functions

format_duration

Formats duration into a human-readable string

format_rfc3339

Format an RFC3339 timestamp 2018-02-14T00:28:07Z

format_rfc3339_nanos

Format an RFC3339 timestamp 2018-02-14T00:28:07.000000000Z

format_rfc3339_seconds

Format an RFC3339 timestamp 2018-02-14T00:28:07Z

parse_duration

Parse duration object 1hour 12min 5s

parse_rfc3339

Parse RFC3339 timestamp 2018-02-14T00:28:07Z

parse_rfc3339_weak

Parse RFC3339-like timestamp 2018-02-14 00:28:07