Interface DateConstructor
new DateConstructornew (): Date;
new DateConstructornew (value: string | number): Date;
new DateConstructornew (year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
new DateConstructornew (value: string | number | Date): Date;
prototype: Date;
now(): number;
parse(s: string): number;
UTC(year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
(): string;
}
Index
Constructors
constructor
- new
Date (): DateConstructor Returns Date
- new
Date (value): DateConstructor Parameters
- value: string | number
Returns Date
- new
Date (year, monthIndex, date?, hours?, minutes?, seconds?, ms?): DateConstructor Parameters
- year: number
The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
- monthIndex: number
The month as a number between 0 and 11 (January to December).
Optional
date: numberThe date as a number between 1 and 31.
Optional
hours: numberMust be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
Optional
minutes: numberMust be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
Optional
seconds: numberMust be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
Optional
ms: numberA number from 0 to 999 that specifies the milliseconds.
Returns Date
- year: number
- new
Date (value): DateConstructor Parameters
- value: string | number | Date
Returns Date
Methods
now
parse
UTC
- UTC(year, monthIndex, date?, hours?, minutes?, seconds?, ms?): number
Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
Parameters
- year: number
The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
- monthIndex: number
The month as a number between 0 and 11 (January to December).
Optional
date: numberThe date as a number between 1 and 31.
Optional
hours: numberMust be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
Optional
minutes: numberMust be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
Optional
seconds: numberMust be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
Optional
ms: numberA number from 0 to 999 that specifies the milliseconds.
Returns number
- year: number
Creates a new Date.