Represents date and time. Local and UTC timezones supported.
( [string| float | Date | [ year, month, day [, hour [, minute [, second [, millisecond ]]]]]] )
Creates new date object. If no parameters were given then initializes date fields to the current time(UTC).
If single string parameter provided then parses date contained in the string.
If single float parameter provided then it is treated as number of milliseconds since midnight, January 1, 1970 UTC.
If single Date parameter provided then copy of that date object is created.
And if year, month, day, etc. provided uses these numeric values to initialize new Date instance. Note: values are in UTC timezone.
new Date(string)
form recognizes date in RFC-822 date format ( http://www.w3.org/Protocols/rfc822/#z28 ) and ISO 8601 ( http://www.w3.org/TR/NOTE-datetime ).
( year, month, day [, hour [, minute [, second [, millisecond ]]]]] )
Static method, constructs new date object from year, month, day, etc.
Note: values are in UTC timezone.
Use it as var date = Date.utc(1999,1,1);
( year, month, day [, hour [, minute [, second [, millisecond ]]]]] )
Static method, constructs new date object from year, month, day, etc.
Note: values are in local timezone .
Use it as var date = Date.local(1999,1,1);
[format:string [, utc:bool ]]) : stringBy default it returns RFC-822 string representation of this date object.
If format is provided then it gets interpreted by strftime rules.
If utc is provided and is true then formatting is made without local timezone shift.
Returns RFC-822 string representation of this date object as UTC date/time.
Returns ISO 8601 string representation of this date object as either local or UTC date/time.
( [longFormat:false|true[, andTime:false|true]] ) returns: string
Returns string representation of the date using current system settings. Local time.
If longFormat is equal exactly true then formats date using system long date format.
If andTime is true then result string will also contain time.
Returns stored time value in milliseconds since midnight, January 1, 1970 UTC.
( string ) returns: float | undefined
Static method. Tries to parse date in string. If result of parsing is successful then returns date as number of milliseconds since midnight, January 1, 1970 UTC.
On error returns undefiend value.
( year, month, day [, hour [, minute [, second [, millisecond ]]]]] ) returns: float | undefined
Static method. Returns number of milliseconds since midnight, January 1, 1970 UTC up to date defined by parameters
( milliseconds ) returns: float
Sets this date object fields equal to date defined by milliseconds parameter. milliseconds is a number (float) of milliseconds since midnight, January 1, 1970 UTC.
Returns name of the month in current user's locale. If longFormat is equal true returns full month name, otherwise - it's abbreviation.
Returns name of the day in current user's locale. If longFormat is equal true returns full week day name, otherwise - it's abbreviation.
Returns true if current clock is using daylight saving time.
Returns shift in milliseconds of current timezone from GMT.
Returns name of current timezone.
Returns calendar difference between two dates so
Date.diff(new Date(2019,8,31),new Date(2019,9,1),#days) == 1; Date.diff(new Date(2019,8,31),new Date(2019,9,1),#months) == 1; // first date is in previous month from second one