[go: up one dir, main page]

Struct worker::Date[][src]

pub struct Date { /* fields omitted */ }
Expand description

The equivalent to a JavaScript Date Object.

let now = Date::now();
let millis = now.as_millis();
// or use a specific point in time:
let t1: Date = DateInit::Millis(1630611511000).into();
let t2: Date = DateInit::String("Thu, 02 Sep 2021 19:38:31 GMT".to_string()).into();

Implementations

Create a new Date, which requires being initialized from a known DateInit value.

Get the current time, represented by a Date.

Convert a Date into its number of milliseconds since the Unix epoch.

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

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

This method tests for !=.

Converts the given value to a String. Read more

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

Performs the conversion.

Performs the conversion.

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.