#[repr(transparent)]pub struct Date {
pub obj: JsValue,
}Fields§
§obj: JsValueImplementations§
Source§impl Date
impl Date
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn get_full_year(&self) -> u32
pub fn get_full_year(&self) -> u32
The getFullYear() method returns the year of the specified date according to local time.
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn get_milliseconds(&self) -> u32
pub fn get_milliseconds(&self) -> u32
The getMilliseconds() method returns the milliseconds in the specified date according to local time.
Source§impl Date
impl Date
Sourcepub fn get_minutes(&self) -> u32
pub fn get_minutes(&self) -> u32
The getMinutes() method returns the minutes in the specified date according to local time.
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn get_seconds(&self) -> u32
pub fn get_seconds(&self) -> u32
The getSeconds() method returns the seconds in the specified date according to local time.
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn get_timezone_offset(&self) -> f64
pub fn get_timezone_offset(&self) -> f64
The getTimezoneOffset() method returns the time zone difference, in minutes,
from current locale (host system settings) to UTC.
Source§impl Date
impl Date
Sourcepub fn get_utc_date(&self) -> u32
pub fn get_utc_date(&self) -> u32
The getUTCDate() method returns the day (date) of the month in the specified date
according to universal time.
Source§impl Date
impl Date
Sourcepub fn get_utc_day(&self) -> u32
pub fn get_utc_day(&self) -> u32
The getUTCDay() method returns the day of the week in the specified date according to universal time,
where 0 represents Sunday.
Source§impl Date
impl Date
Sourcepub fn get_utc_full_year(&self) -> u32
pub fn get_utc_full_year(&self) -> u32
The getUTCFullYear() method returns the year in the specified date according to universal time.
Source§impl Date
impl Date
Sourcepub fn get_utc_hours(&self) -> u32
pub fn get_utc_hours(&self) -> u32
The getUTCHours() method returns the hours in the specified date according to universal time.
Source§impl Date
impl Date
Sourcepub fn get_utc_milliseconds(&self) -> u32
pub fn get_utc_milliseconds(&self) -> u32
The getUTCMilliseconds() method returns the milliseconds in the specified date
according to universal time.
Source§impl Date
impl Date
Sourcepub fn get_utc_minutes(&self) -> u32
pub fn get_utc_minutes(&self) -> u32
The getUTCMinutes() method returns the minutes in the specified date according to universal time.
Source§impl Date
impl Date
Sourcepub fn get_utc_month(&self) -> u32
pub fn get_utc_month(&self) -> u32
The 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).
Source§impl Date
impl Date
Sourcepub fn get_utc_seconds(&self) -> u32
pub fn get_utc_seconds(&self) -> u32
The getUTCSeconds() method returns the seconds in the specified date according to universal time.
Source§impl Date
impl Date
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn new_with_year_month(year: u32, month: i32) -> Date
pub fn new_with_year_month(year: u32, month: i32) -> Date
Creates a JavaScript Date instance that represents
a single moment in time. Date objects are based on a time value that is
the number of milliseconds since 1 January 1970 UTC.
Source§impl Date
impl Date
Source§impl Date
impl Date
Source§impl Date
impl Date
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn new_with_year_month_day_hr_min_sec_milli(
year: u32,
month: i32,
day: i32,
hr: i32,
min: i32,
sec: i32,
milli: i32,
) -> Date
pub fn new_with_year_month_day_hr_min_sec_milli( year: u32, month: i32, day: i32, hr: i32, min: i32, sec: i32, milli: i32, ) -> Date
Creates a JavaScript Date instance that represents
a single moment in time. Date objects are based on a time value that is
the number of milliseconds since 1 January 1970 UTC.
Source§impl Date
impl Date
Source§impl Date
impl Date
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn set_full_year(&self, year: u32) -> f64
pub fn set_full_year(&self, year: u32) -> f64
The setFullYear() method sets the full year for a specified date according to local time.
Returns new timestamp.
Source§impl Date
impl Date
Sourcepub fn set_full_year_with_month(&self, year: u32, month: i32) -> f64
pub fn set_full_year_with_month(&self, year: u32, month: i32) -> f64
The setFullYear() method sets the full year for a specified date according to local time.
Returns new timestamp.
Source§impl Date
impl Date
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn set_milliseconds(&self, milliseconds: u32) -> f64
pub fn set_milliseconds(&self, milliseconds: u32) -> f64
The setMilliseconds() method sets the milliseconds for a specified date according to local time.
Source§impl Date
impl Date
Sourcepub fn set_minutes(&self, minutes: u32) -> f64
pub fn set_minutes(&self, minutes: u32) -> f64
The setMinutes() method sets the minutes for a specified date according to local time.
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn set_seconds(&self, seconds: u32) -> f64
pub fn set_seconds(&self, seconds: u32) -> f64
The setSeconds() method sets the seconds for a specified date according to local time.
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn set_utc_date(&self, day: u32) -> f64
pub fn set_utc_date(&self, day: u32) -> f64
The setUTCDate() method sets the day of the month for a specified date
according to universal time.
Source§impl Date
impl Date
Sourcepub fn set_utc_full_year(&self, year: u32) -> f64
pub fn set_utc_full_year(&self, year: u32) -> f64
The setUTCFullYear() method sets the full year for a specified date according to universal time.
Source§impl Date
impl Date
Sourcepub fn set_utc_full_year_with_month(&self, year: u32, month: i32) -> f64
pub fn set_utc_full_year_with_month(&self, year: u32, month: i32) -> f64
The setUTCFullYear() method sets the full year for a specified date according to universal time.
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn set_utc_hours(&self, hours: u32) -> f64
pub fn set_utc_hours(&self, hours: u32) -> f64
The 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.
Source§impl Date
impl Date
Sourcepub fn set_utc_milliseconds(&self, milliseconds: u32) -> f64
pub fn set_utc_milliseconds(&self, milliseconds: u32) -> f64
The setUTCMilliseconds() method sets the milliseconds for a specified date
according to universal time.
Source§impl Date
impl Date
Sourcepub fn set_utc_minutes(&self, minutes: u32) -> f64
pub fn set_utc_minutes(&self, minutes: u32) -> f64
The setUTCMinutes() method sets the minutes for a specified date according to universal time.
Source§impl Date
impl Date
Sourcepub fn set_utc_month(&self, month: u32) -> f64
pub fn set_utc_month(&self, month: u32) -> f64
The setUTCMonth() method sets the month for a specified date according to universal time.
Source§impl Date
impl Date
Sourcepub fn set_utc_seconds(&self, seconds: u32) -> f64
pub fn set_utc_seconds(&self, seconds: u32) -> f64
The setUTCSeconds() method sets the seconds for a specified date according to universal time.
Source§impl Date
impl Date
Sourcepub fn to_date_string(&self) -> JsString
pub fn to_date_string(&self) -> JsString
The toDateString() method returns the date portion of a Date object
in human readable form in American English.
Source§impl Date
impl Date
Sourcepub fn to_iso_string(&self) -> JsString
pub fn to_iso_string(&self) -> JsString
The 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”
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn to_locale_date_string(&self, locale: &str, options: &JsValue) -> JsString
pub fn to_locale_date_string(&self, locale: &str, options: &JsValue) -> JsString
The 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.
Source§impl Date
impl Date
Sourcepub fn to_locale_string(&self, locale: &str, options: &JsValue) -> JsString
pub fn to_locale_string(&self, locale: &str, options: &JsValue) -> JsString
The 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.
Source§impl Date
impl Date
Sourcepub fn to_locale_time_string(&self, locale: &str) -> JsString
pub fn to_locale_time_string(&self, locale: &str) -> JsString
The 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.
Source§impl Date
impl Date
pub fn to_locale_time_string_with_options( &self, locale: &str, options: &JsValue, ) -> JsString
Source§impl Date
impl Date
Source§impl Date
impl Date
Sourcepub fn to_time_string(&self) -> JsString
pub fn to_time_string(&self) -> JsString
The toTimeString() method returns the time portion of a Date object in human
readable form in American English.
Source§impl Date
impl Date
Sourcepub fn to_utc_string(&self) -> JsString
pub fn to_utc_string(&self) -> JsString
The toUTCString() method converts a date to a string,
using the UTC time zone.
Methods from Deref<Target = Object>§
Sourcepub fn constructor(&self) -> Function
pub fn constructor(&self) -> Function
The constructor property returns a reference to the Object constructor
function that created the instance object.
Sourcepub fn has_own_property(&self, property: &JsValue) -> bool
pub fn has_own_property(&self, property: &JsValue) -> bool
The hasOwnProperty() method returns a boolean indicating whether the
object has the specified property as its own property (as opposed to
inheriting it).
Sourcepub fn is_prototype_of(&self, value: &JsValue) -> bool
pub fn is_prototype_of(&self, value: &JsValue) -> bool
The isPrototypeOf() method checks if an object exists in another
object’s prototype chain.
Sourcepub fn property_is_enumerable(&self, property: &JsValue) -> bool
pub fn property_is_enumerable(&self, property: &JsValue) -> bool
The propertyIsEnumerable() method returns a Boolean indicating
whether the specified property is enumerable.
Sourcepub fn to_locale_string(&self) -> JsString
pub fn to_locale_string(&self) -> JsString
The toLocaleString() method returns a string representing the object.
This method is meant to be overridden by derived objects for
locale-specific purposes.
Sourcepub fn to_string(&self) -> JsString
pub fn to_string(&self) -> JsString
The toString() method returns a string representing the object.
Methods from Deref<Target = JsValue>§
pub const NULL: JsValue
pub const UNDEFINED: JsValue
pub const TRUE: JsValue
pub const FALSE: JsValue
Sourcepub fn id(&self) -> u64
pub fn id(&self) -> u64
Get the heap ID for this value.
This is used internally for encoding values to send to JS.
Sourcepub fn unchecked_into_f64(&self) -> f64
pub fn unchecked_into_f64(&self) -> f64
Returns the value as f64 without type checking. Used by serde-wasm-bindgen for numeric conversions.
Sourcepub fn has_type<T>(&self) -> boolwhere
T: JsCast,
pub fn has_type<T>(&self) -> boolwhere
T: JsCast,
Check if this value is an instance of a specific JS type.
Sourcepub fn checked_div(&self, rhs: &JsValue) -> JsValue
pub fn checked_div(&self, rhs: &JsValue) -> JsValue
Checked division.
Sourcepub fn unsigned_shr(&self, rhs: &JsValue) -> u32
pub fn unsigned_shr(&self, rhs: &JsValue) -> u32
Unsigned right shift.
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Check if this value is a function.
Sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Check if this value is undefined.
Sourcepub fn js_in(&self, obj: &JsValue) -> bool
pub fn js_in(&self, obj: &JsValue) -> bool
Check if this value has a property with the given name.
Sourcepub fn as_debug_string(&self) -> String
pub fn as_debug_string(&self) -> String
Get a debug string representation of the value.
Trait Implementations§
Source§impl BatchableResult for Date
impl BatchableResult for Date
Source§impl BinaryDecode for Date
impl BinaryDecode for Date
fn decode(decoder: &mut DecodedData<'_>) -> Result<Self, DecodeError>
Source§impl BinaryEncode for &Date
impl BinaryEncode for &Date
fn encode(self, encoder: &mut EncodedData)
Source§impl BinaryEncode for Date
impl BinaryEncode for Date
fn encode(self, encoder: &mut EncodedData)
Source§impl EncodeTypeDef for Date
impl EncodeTypeDef for Date
Source§fn encode_type_def(buf: &mut Vec<u8>)
fn encode_type_def(buf: &mut Vec<u8>)
Source§impl JsCast for Date
impl JsCast for Date
Source§fn instanceof(__val: &JsValue) -> bool
fn instanceof(__val: &JsValue) -> bool
Source§fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js(val: JsValue) -> Self
Source§fn unchecked_from_js_ref(val: &JsValue) -> &Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
Source§fn is_type_of(val: &JsValue) -> bool
fn is_type_of(val: &JsValue) -> bool
JsValue provided
is a value of this type. Read moreSource§fn has_type<T>(&self) -> boolwhere
T: JsCast,
fn has_type<T>(&self) -> boolwhere
T: JsCast,
T. Read moreSource§fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
Source§fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
Source§fn is_instance_of<T>(&self) -> boolwhere
T: JsCast,
fn is_instance_of<T>(&self) -> boolwhere
T: JsCast,
T. Read more