[][src]Struct boa::builtins::date::Date

pub struct 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]

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]

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]

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]

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]

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]

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]

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]

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]

impl Ord for Date[src]

impl PartialEq<Date> for Date[src]

impl PartialOrd<Date> for Date[src]

impl StructuralEq for Date[src]

impl StructuralPartialEq for Date[src]

impl Trace for Date[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> NativeObject for T where
    T: Any + Debug + Trace
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,