[−][src]Struct boa::builtins::date::Date
Implementations
impl Date
[src]
pub fn to_local(&self) -> Option<DateTime<Local>>
[src]
Converts the Date
to a local DateTime
.
If the Date
is invalid (i.e. NAN), this function will return None
.
pub fn to_utc(&self) -> Option<DateTime<Utc>>
[src]
Converts the Date
to a UTC DateTime
.
If the Date
is invalid (i.e. NAN), this function will return None
.
pub fn set_components(
&mut self,
utc: bool,
year: Option<f64>,
month: Option<f64>,
day: Option<f64>,
hour: Option<f64>,
minute: Option<f64>,
second: Option<f64>,
millisecond: Option<f64>
)
[src]
&mut self,
utc: bool,
year: Option<f64>,
month: Option<f64>,
day: Option<f64>,
hour: Option<f64>,
minute: Option<f64>,
second: Option<f64>,
millisecond: Option<f64>
)
Optionally sets the individual components of the Date
.
Each component does not have to be within the range of valid values. For example, if month
is too large
then year
will be incremented by the required amount.
pub fn get_date(&self) -> f64
[src]
Date.prototype.getDate()
The getDate()
method returns the day of the month for the specified date according to local time.
More information:
pub fn get_day(&self) -> f64
[src]
Date.prototype.getDay()
The getDay()
method returns the day of the week for the specified date according to local time, where 0
represents Sunday.
More information:
pub fn get_full_year(&self) -> f64
[src]
Date.prototype.getFullYear()
The getFullYear()
method returns the year of the specified date according to local time.
More information:
pub fn get_hours(&self) -> f64
[src]
Date.prototype.getHours()
The getHours()
method returns the hour for the specified date, according to local time.
More information:
pub fn get_milliseconds(&self) -> f64
[src]
Date.prototype.getMilliseconds()
The getMilliseconds()
method returns the milliseconds in the specified date according to local time.
More information:
pub fn get_minutes(&self) -> f64
[src]
Date.prototype.getMinutes()
The getMinutes()
method returns the minutes in the specified date according to local time.
More information:
pub fn get_month(&self) -> f64
[src]
Date.prototype.getMonth()
The 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).
More information:
pub fn get_seconds(&self) -> f64
[src]
Date.prototype.getSeconds()
The getSeconds()
method returns the seconds in the specified date according to local time.
More information:
pub fn get_year(&self) -> f64
[src]
Date.prototype.getYear()
The getYear() method returns the year in the specified date according to local time. Because getYear() does not return full years ("year 2000 problem"), it is no longer used and has been replaced by the getFullYear() method.
More information:
pub fn get_time(&self) -> f64
[src]
Date.prototype.getTime()
The getTime()
method returns the number of milliseconds since the Unix Epoch.
More information:
pub fn get_timezone_offset() -> f64
[src]
Date.prototype.getTimeZoneOffset()
The getTimezoneOffset() method returns the time zone difference, in minutes, from current locale (host system settings) to UTC.
More information:
pub fn get_utc_date(&self) -> f64
[src]
Date.prototype.getUTCDate()
The getUTCDate()
method returns the day (date) of the month in the specified date according to universal time.
More information:
pub fn get_utc_day(&self) -> f64
[src]
Date.prototype.getUTCDay()
The getUTCDay()
method returns the day of the week in the specified date according to universal time, where 0
represents Sunday.
More information:
pub fn get_utc_full_year(&self) -> f64
[src]
Date.prototype.getUTCFullYear()
The getUTCFullYear()
method returns the year in the specified date according to universal time.
More information:
pub fn get_utc_hours(&self) -> f64
[src]
Date.prototype.getUTCHours()
The getUTCHours()
method returns the hours in the specified date according to universal time.
More information:
pub fn get_utc_milliseconds(&self) -> f64
[src]
Date.prototype.getUTCMilliseconds()
The getUTCMilliseconds()
method returns the milliseconds portion of the time object's value.
More information:
pub fn get_utc_minutes(&self) -> f64
[src]
Date.prototype.getUTCMinutes()
The getUTCMinutes()
method returns the minutes in the specified date according to universal time.
More information:
pub fn get_utc_month(&self) -> f64
[src]
Date.prototype.getUTCMonth()
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).
More information:
pub fn get_utc_seconds(&self) -> f64
[src]
Date.prototype.getUTCSeconds()
The getUTCSeconds()
method returns the seconds in the specified date according to universal time.
More information:
pub fn set_date(&mut self, day: Option<f64>)
[src]
Date.prototype.setDate()
The setDate()
method sets the day of the Date
object relative to the beginning of the currently set
month.
More information:
pub fn set_full_year(
&mut self,
year: Option<f64>,
month: Option<f64>,
day: Option<f64>
)
[src]
&mut self,
year: Option<f64>,
month: Option<f64>,
day: Option<f64>
)
Date.prototype.setFullYear()
The setFullYear()
method sets the full year for a specified date according to local time. Returns new
timestamp.
More information:
pub fn set_hours(
&mut self,
hour: Option<f64>,
minute: Option<f64>,
second: Option<f64>,
millisecond: Option<f64>
)
[src]
&mut self,
hour: Option<f64>,
minute: Option<f64>,
second: Option<f64>,
millisecond: Option<f64>
)
Date.prototype.setHours()
The 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.
More information:
pub fn set_milliseconds(&mut self, millisecond: Option<f64>)
[src]
Date.prototype.setMilliseconds()
The setMilliseconds()
method sets the milliseconds for a specified date according to local time.
More information:
pub fn set_minutes(
&mut self,
minute: Option<f64>,
second: Option<f64>,
millisecond: Option<f64>
)
[src]
&mut self,
minute: Option<f64>,
second: Option<f64>,
millisecond: Option<f64>
)
Date.prototype.setMinutes()
The setMinutes()
method sets the minutes for a specified date according to local time.
More information:
pub fn set_month(&mut self, month: Option<f64>, day: Option<f64>)
[src]
Date.prototype.setMonth()
The setMonth()
method sets the month for a specified date according to the currently set year.
More information:
pub fn set_seconds(&mut self, second: Option<f64>, millisecond: Option<f64>)
[src]
Date.prototype.setSeconds()
The setSeconds()
method sets the seconds for a specified date according to local time.
More information:
pub fn set_year(
&mut self,
year: Option<f64>,
month: Option<f64>,
day: Option<f64>
)
[src]
&mut self,
year: Option<f64>,
month: Option<f64>,
day: Option<f64>
)
Date.prototype.setYear()
The setYear()
method sets the year for a specified date according to local time.
More information:
pub fn set_time(&mut self, time: Option<f64>)
[src]
Date.prototype.setTime()
The setTime()
method sets the Date object to the time represented by a number of milliseconds since
January 1, 1970, 00:00:00 UTC.
More information:
pub fn set_utc_date(&mut self, day: Option<f64>)
[src]
Date.prototype.setUTCDate()
The setUTCDate()
method sets the day of the month for a specified date according to universal time.
More information:
pub fn set_utc_full_year(
&mut self,
year: Option<f64>,
month: Option<f64>,
day: Option<f64>
)
[src]
&mut self,
year: Option<f64>,
month: Option<f64>,
day: Option<f64>
)
Date.prototype.setFullYear()
The setFullYear()
method sets the full year for a specified date according to local time. Returns new
timestamp.
More information:
pub fn set_utc_hours(
&mut self,
hour: Option<f64>,
minute: Option<f64>,
second: Option<f64>,
millisecond: Option<f64>
)
[src]
&mut self,
hour: Option<f64>,
minute: Option<f64>,
second: Option<f64>,
millisecond: Option<f64>
)
Date.prototype.setUTCHours()
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.
More information:
pub fn set_utc_milliseconds(&mut self, millisecond: Option<f64>)
[src]
Date.prototype.setUTCMilliseconds()
The setUTCMilliseconds()
method sets the milliseconds for a specified date according to universal time.
More information:
pub fn set_utc_minutes(
&mut self,
minute: Option<f64>,
second: Option<f64>,
millisecond: Option<f64>
)
[src]
&mut self,
minute: Option<f64>,
second: Option<f64>,
millisecond: Option<f64>
)
Date.prototype.setUTCMinutes()
The setUTCMinutes()
method sets the minutes for a specified date according to universal time.
More information:
pub fn set_utc_month(&mut self, month: Option<f64>, day: Option<f64>)
[src]
Date.prototype.setUTCMonth()
The setUTCMonth()
method sets the month for a specified date according to universal time.
More information:
pub fn set_utc_seconds(&mut self, second: Option<f64>, millisecond: Option<f64>)
[src]
Date.prototype.setUTCSeconds()
The setUTCSeconds()
method sets the seconds for a specified date according to universal time.
More information:
pub fn to_date_string(&self) -> String
[src]
Date.prototype.toDateString()
The toDateString()
method returns the date portion of a Date object in English.
More information:
pub fn to_gmt_string(&self) -> String
[src]
Date.prototype.toGMTString()
The toGMTString()
method converts a date to a string, using Internet Greenwich Mean Time (GMT) conventions.
More information:
pub fn to_iso_string(&self) -> String
[src]
Date.prototype.toISOString()
The toISOString()
method returns a string in simplified extended ISO format (ISO 8601).
More information:
pub fn to_json(&self) -> String
[src]
Date.prototype.toJSON()
The toJSON()
method returns a string representation of the Date
object.
More information:
pub fn to_time_string(&self) -> String
[src]
Date.prototype.toTimeString()
The toTimeString()
method returns the time portion of a Date object in human readable form in American
English.
More information:
pub fn to_utc_string(&self) -> String
[src]
Date.prototype.toUTCString()
The toUTCString()
method returns a string representing the specified Date object.
More information:
pub fn value_of(&self) -> f64
[src]
Date.prototype.valueOf()
The valueOf()
method returns the primitive value of a Date
object.
More information:
Trait Implementations
impl Clone for Date
[src]
impl Copy for Date
[src]
impl Debug for Date
[src]
impl Default for Date
[src]
impl Display for Date
[src]
impl Eq for Date
[src]
impl Finalize for Date
[src]
impl Hash for Date
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Date
[src]
pub fn cmp(&self, other: &Date) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Date> for Date
[src]
impl PartialOrd<Date> for Date
[src]
pub fn partial_cmp(&self, other: &Date) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Date) -> bool
[src]
pub fn le(&self, other: &Date) -> bool
[src]
pub fn gt(&self, other: &Date) -> bool
[src]
pub fn ge(&self, other: &Date) -> bool
[src]
impl StructuralEq for Date
[src]
impl StructuralPartialEq for Date
[src]
impl Trace for Date
[src]
Auto Trait Implementations
impl RefUnwindSafe for Date
[src]
impl Send for Date
[src]
impl Sync for Date
[src]
impl Unpin for Date
[src]
impl UnwindSafe for Date
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> NativeObject for T where
T: Any + Debug + Trace,
[src]
T: Any + Debug + Trace,
pub fn as_any(&Self) -> &(dyn Any + 'static)
[src]
pub fn as_mut_any(&mut Self) -> &mut (dyn Any + 'static)
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,