Struct Date
#[repr(transparent)]
pub struct Date { /* private fields */ }
Implementations
impl Date
fn get_utc_seconds(&self) -> u32The
getUTCSeconds()method returns the seconds in the specified date according to universal time.
impl Date
fn to_time_string(&self) -> JsStringThe
toTimeString()method returns the time portion of a Date object in human readable form in American English.
impl Date
fn new_with_year_month(year: u32, month: i32) -> DateCreates a JavaScript
Dateinstance that represents a single moment in time.Dateobjects are based on a time value that is the number of milliseconds since 1 January 1970 UTC.
impl Date
fn value_of(&self) -> f64The
valueOf()method returns the primitive value of a Date object.
impl Date
fn new_with_year_month_day_hr_min(year: u32, month: i32, day: i32, hr: i32, min: i32) -> DateCreates a JavaScript
Dateinstance that represents a single moment in time.Dateobjects are based on a time value that is the number of milliseconds since 1 January 1970 UTC.
impl Date
fn now() -> f64The
Date.now()method returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.
impl Date
fn set_full_year(&self, year: u32) -> f64The
setFullYear()method sets the full year for a specified date according to local time. Returns new timestamp.
impl Date
fn set_hours(&self, hours: u32) -> f64The
setHours()method sets the hours for a specified date according to local time, and returns the number of milliseconds since January 1, 1970 00:00:00 UTC until the time represented by the updated Date instance.
impl Date
fn set_month(&self, month: u32) -> f64The
setMonth()method sets the month for a specified date according to the currently set year.
impl Date
fn get_date(&self) -> u32The
getDate()method returns the day of the month for the specified date according to local time.
impl Date
fn set_utc_date(&self, day: u32) -> f64The
setUTCDate()method sets the day of the month for a specified date according to universal time.
impl Date
fn get_hours(&self) -> u32The
getHours()method returns the hour for the specified date, according to local time.
impl Date
fn set_utc_full_year_with_month_date(&self, year: u32, month: i32, date: i32) -> f64The
setUTCFullYear()method sets the full year for a specified date according to universal time.
impl Date
fn get_month(&self) -> u32The
getMonth()method returns the month in the specified date according to local time, as a zero-based value (where zero indicates the first month of the year).
impl Date
fn set_utc_minutes(&self, minutes: u32) -> f64The
setUTCMinutes()method sets the minutes for a specified date according to universal time.
impl Date
fn get_timezone_offset(&self) -> f64The
getTimezoneOffset()method returns the time zone difference, in minutes, from current locale (host system settings) to UTC.
impl Date
fn to_date_string(&self) -> JsStringThe
toDateString()method returns the date portion of a Date object in human readable form in American English.
impl Date
fn get_utc_full_year(&self) -> u32The
getUTCFullYear()method returns the year in the specified date according to universal time.
impl Date
fn to_locale_date_string(&self, locale: &str, options: &JsValue) -> JsStringThe
toLocaleDateString()method returns a string with a language sensitive representation of the date portion of this date. The new locales and options arguments let applications specify the language whose formatting conventions should be used and allow to customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent.
impl Date
fn get_utc_minutes(&self) -> u32The
getUTCMinutes()method returns the minutes in the specified date according to universal time.
impl Date
fn to_locale_time_string_with_options(&self, locale: &str, options: &JsValue) -> JsString
impl Date
fn new(init: &JsValue) -> DateCreates a JavaScript
Dateinstance that represents a single moment in time.Dateobjects are based on a time value that is the number of milliseconds since 1 January 1970 UTC.
impl Date
fn to_utc_string(&self) -> JsStringThe
toUTCString()method converts a date to a string, using the UTC time zone.
impl Date
fn new_with_year_month_day(year: u32, month: i32, day: i32) -> DateCreates a JavaScript
Dateinstance that represents a single moment in time.Dateobjects are based on a time value that is the number of milliseconds since 1 January 1970 UTC.
impl Date
fn new_with_year_month_day_hr_min_sec(year: u32, month: i32, day: i32, hr: i32, min: i32, sec: i32) -> DateCreates a JavaScript
Dateinstance that represents a single moment in time.Dateobjects are based on a time value that is the number of milliseconds since 1 January 1970 UTC.
impl Date
fn parse(date: &str) -> f64The
Date.parse()method parses a string representation of a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC orNaNif the string is unrecognized or, in some cases, contains illegal date values (e.g. 2015-02-31).
impl Date
fn set_full_year_with_month(&self, year: u32, month: i32) -> f64The
setFullYear()method sets the full year for a specified date according to local time. Returns new timestamp.
impl Date
fn set_milliseconds(&self, milliseconds: u32) -> f64The
setMilliseconds()method sets the milliseconds for a specified date according to local time.
impl Date
fn set_seconds(&self, seconds: u32) -> f64The
setSeconds()method sets the seconds for a specified date according to local time.
impl Date
fn get_day(&self) -> u32The
getDay()method returns the day of the week for the specified date according to local time, where 0 represents Sunday. For the day of the month see getDate().
impl Date
fn set_utc_full_year(&self, year: u32) -> f64The
setUTCFullYear()method sets the full year for a specified date according to universal time.
impl Date
fn get_milliseconds(&self) -> u32The
getMilliseconds()method returns the milliseconds in the specified date according to local time.
impl Date
fn set_utc_hours(&self, hours: u32) -> f64The
setUTCHours()method sets the hour for a specified date according to universal time, and returns the number of milliseconds since January 1, 1970 00:00:00 UTC until the time represented by the updated Date instance.
impl Date
fn get_seconds(&self) -> u32The
getSeconds()method returns the seconds in the specified date according to local time.
impl Date
fn set_utc_month(&self, month: u32) -> f64The
setUTCMonth()method sets the month for a specified date according to universal time.
impl Date
fn get_utc_date(&self) -> u32The
getUTCDate()method returns the day (date) of the month in the specified date according to universal time.
impl Date
fn to_iso_string(&self) -> JsStringThe
toISOString()method returns a string in simplified extended ISO format (ISO 8601), which is always 24 or 27 characters long (YYYY-MM-DDTHH:mm:ss.sssZ or ±YYYYYY-MM-DDTHH:mm:ss.sssZ, respectively). The timezone is always zero UTC offset, as denoted by the suffix "Z"
impl Date
fn get_utc_hours(&self) -> u32The
getUTCHours()method returns the hours in the specified date according to universal time.
impl Date
fn to_locale_string(&self, locale: &str, options: &JsValue) -> JsStringThe
toLocaleString()method returns a string with a language sensitive representation of this date. The new locales and options arguments let applications specify the language whose formatting conventions should be used and customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent.
impl Date
fn get_utc_month(&self) -> u32The
getUTCMonth()returns the month of the specified date according to universal time, as a zero-based value (where zero indicates the first month of the year).
impl Date
fn to_string(&self) -> JsStringThe
toString()method returns a string representing the specified Date object.
impl Date
fn new_0() -> DateCreates a JavaScript
Dateinstance that represents the current moment in time.
impl Date
fn utc(year: f64, month: f64) -> f64The
Date.UTC()method accepts the same parameters as the longest form of the constructor, and returns the number of milliseconds in aDateobject since January 1, 1970, 00:00:00, universal time.
impl Date
fn new_with_year_month_day_hr(year: u32, month: i32, day: i32, hr: i32) -> DateCreates a JavaScript
Dateinstance that represents a single moment in time.Dateobjects are based on a time value that is the number of milliseconds since 1 January 1970 UTC.
impl Date
fn new_with_year_month_day_hr_min_sec_milli(year: u32, month: i32, day: i32, hr: i32, min: i32, sec: i32, milli: i32) -> DateCreates a JavaScript
Dateinstance that represents a single moment in time.Dateobjects are based on a time value that is the number of milliseconds since 1 January 1970 UTC.
impl Date
fn set_date(&self, day: u32) -> f64The
setDate()method sets the day of the Date object relative to the beginning of the currently set month.
impl Date
fn set_full_year_with_month_date(&self, year: u32, month: i32, date: i32) -> f64The
setFullYear()method sets the full year for a specified date according to local time. Returns new timestamp.
impl Date
fn set_minutes(&self, minutes: u32) -> f64The
setMinutes()method sets the minutes for a specified date according to local time.
impl Date
fn set_time(&self, time: f64) -> f64The
setTime()method sets the Date object to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC.
impl Date
fn get_full_year(&self) -> u32The
getFullYear()method returns the year of the specified date according to local time.
impl Date
fn set_utc_full_year_with_month(&self, year: u32, month: i32) -> f64The
setUTCFullYear()method sets the full year for a specified date according to universal time.
impl Date
fn get_minutes(&self) -> u32The
getMinutes()method returns the minutes in the specified date according to local time.
impl Date
fn set_utc_milliseconds(&self, milliseconds: u32) -> f64The
setUTCMilliseconds()method sets the milliseconds for a specified date according to universal time.
impl Date
fn get_time(&self) -> f64The
getTime()method returns the numeric value corresponding to the time for the specified date according to universal time.
impl Date
fn set_utc_seconds(&self, seconds: u32) -> f64The
setUTCSeconds()method sets the seconds for a specified date according to universal time.
impl Date
fn get_utc_day(&self) -> u32The
getUTCDay()method returns the day of the week in the specified date according to universal time, where 0 represents Sunday.
impl Date
fn to_json(&self) -> JsStringThe
toJSON()method returns a string representation of the Date object.
impl Date
fn get_utc_milliseconds(&self) -> u32The
getUTCMilliseconds()method returns the milliseconds in the specified date according to universal time.
impl Date
fn to_locale_time_string(&self, locale: &str) -> JsStringThe
toLocaleTimeString()method returns a string with a language sensitive representation of the time portion of this date. The new locales and options arguments let applications specify the language whose formatting conventions should be used and customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent.
Trait Implementations
impl AsRef<Date> for Date
fn as_ref(&self) -> &Date
impl AsRef<JsValue> for Date
fn as_ref(&self) -> &JsValue
impl AsRef<Object> for Date
fn as_ref(&self) -> &Object
impl Clone for Date
fn clone(&self) -> Self
impl Debug for Date
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Deref for Date
type Target = Object;fn deref(&self) -> &Object
impl Eq for Date
impl ErasableGeneric for Date
type Repr = JsValue;
impl From<JsValue> for Date
fn from(obj: JsValue) -> Self
impl FromWasmAbi for Date
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl IntoJsGeneric for Date
where
Date: JsGeneric,
type JsCanon = Date;fn to_js(self) -> Date
impl IntoWasmAbi for Date
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl JsCast for Date
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl LongRefFromWasmAbi for Date
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = Date;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl OptionFromWasmAbi for Date
fn is_none(abi: &Self::Abi) -> bool
impl OptionIntoWasmAbi for Date
fn none() -> Self::Abi
impl PartialEq for Date
fn eq(&self, other: &Self) -> bool
impl Promising for Date
type Resolution = Date;
impl RefFromWasmAbi for Date
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<Date>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl StructuralPartialEq for Date
impl UpcastFrom<Date> for Date
impl WasmDescribe for Date
fn describe()