Home Reference Source
public class | source

Date

Represents an instant capturing the date, but not the time, nor the timezone. Created Date objects are frozen with Object.freeze() in constructor and thus immutable.

Static Method Summary

Static Public Methods
public static

fromStandardDate(standardDate: global.Date): Date

Create a Date object from the given standard JavaScript Date.

Constructor Summary

Public Constructor
public

constructor(year: NumberOrInteger, month: NumberOrInteger, day: NumberOrInteger)

Member Summary

Public Members
public

day: NumberOrInteger

The day.

public

month: NumberOrInteger

The month.

public

year: NumberOrInteger

The year.

Method Summary

Public Methods
public

toStandardDate(): StandardDate

Convert date to standard JavaScript Date.

Static Public Methods

public static fromStandardDate(standardDate: global.Date): Date source

Create a Date object from the given standard JavaScript Date. Hour, minute, second, millisecond and time zone offset components of the given date are ignored.

Params:

NameTypeAttributeDescription
standardDate global.Date

The standard JavaScript date to convert.

Return:

Date

New Date.

Public Constructors

public constructor(year: NumberOrInteger, month: NumberOrInteger, day: NumberOrInteger) source

Params:

NameTypeAttributeDescription
year NumberOrInteger

The year for the new local date.

month NumberOrInteger

The month for the new local date.

day NumberOrInteger

The day for the new local date.

Public Members

public day: NumberOrInteger source

The day.

public month: NumberOrInteger source

The month.

public year: NumberOrInteger source

The year.

Public Methods

public toStandardDate(): StandardDate source

Convert date to standard JavaScript Date.

The time component of the returned Date is set to midnight and the time zone is set to UTC.

Return:

StandardDate

Standard JavaScript Date at 00:00:00.000 UTC.