Struct datetime::Instant [] [src]

pub struct Instant { /* fields omitted */ }

An instant is an exact point on the timeline, irrespective of time zone or calendar format, with millisecond precision.

Internally, this is represented by a 64-bit integer of seconds, and a 16-bit integer of milliseconds. This means that it will overflow (and thus be unsuitable for) instants past GMT 15:30:08, Sunday 4th December, 292,277,026,596 (yes, that’s a year)

Methods

impl Instant
[src]

[src]

Creates a new Instant set to the number of seconds since the Unix epoch, and zero milliseconds.

[src]

Creates a new Instant set to the number of seconds since the Unix epoch, along with the number of milliseconds so far this second.

[src]

Creates a new Instant set to the computer’s current time.

[src]

Creates a new Instant set to the Unix epoch.

[src]

Returns the number of seconds at this instant

[src]

Returns the number of milliseconds at this instant

Trait Implementations

impl PartialEq for Instant
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for Instant
[src]

impl PartialOrd for Instant
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for Instant
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl Clone for Instant
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Instant
[src]

impl Debug for Instant
[src]

[src]

Formats the value using the given formatter.

impl Add<Duration> for Instant
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Sub<Duration> for Instant
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.