logo

Crate time

source · []
Expand description

Simple time handling.

Usage

This crate is on crates.io and can be used by adding time to the dependencies in your project’s Cargo.toml.

[dependencies]
time = "0.1"

And this in your crate root:

extern crate time;

This crate uses the same syntax for format strings as the strftime() function from the C standard library.

Structs

ISO 8601 time duration with nanosecond precision. This also allows for the negative duration; see individual methods for details.

Represents error when converting Duration to/from a standard library implementation

An opaque structure representing a moment in time.

A structure representing a moment in time.

A record specifying a time value in seconds and nanoseconds, where nanoseconds represent the offset from the given second.

Holds a calendar date and time broken down into its components (year, month, day, and so on), also called a broken-down time value.

A wrapper around a Tm and format string that implements Display.

Enums

Functions

Returns the specified time in the local timezone

Returns the specified time in UTC

Returns the current time as a timespec containing the seconds and nanoseconds since 1970-01-01T00:00:00Z.

Returns the current time in the local timezone

Returns the current time in UTC

Returns the current value of a high-resolution performance counter in nanoseconds since an unspecified epoch.

Returns the current value of a high-resolution performance counter in seconds since an unspecified epoch.

Formats the time according to the format string.

Parses the time from the string according to the format string.