pub struct Epoch { /* private fields */ }
Expand description

A struct that provides conversions to/from epochs/date/time.

Implementations

Instantiates a new Epoch

Creates a new Epoch from DateTimeParts

Creates an epoch from seconds

Creates an epoch from milliseconds

Creates an epoch from microseconds

Creates an epoch from nanoseconds

Returns the epoch as seconds

Returns the epoch as milliseconds

Returns the epoch as microseconds

Returns the epoch as nanoseconds

Formats the epoch as a date/time

Trait Implementations

Formats the value using the given formatter. Read more

Returns the current epoch

Attempts to convert DateTimeParts into an Epoch

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.