Interface Date
[toPrimitive](hint: "default"): string;
[toPrimitive](hint: "string"): string;
[toPrimitive](hint: "number"): number;
[toPrimitive](hint: string): string | number;
getDate(): number;
getDay(): number;
getFullYear(): number;
getHours(): number;
getMilliseconds(): number;
getMinutes(): number;
getMonth(): number;
getSeconds(): number;
getTime(): number;
getTimezoneOffset(): number;
getUTCDate(): number;
getUTCDay(): number;
getUTCFullYear(): number;
getUTCHours(): number;
getUTCMilliseconds(): number;
getUTCMinutes(): number;
getUTCMonth(): number;
getUTCSeconds(): number;
setDate(date: number): number;
setFullYear(year: number, month?: number, date?: number): number;
setHours(hours: number, min?: number, sec?: number, ms?: number): number;
setMilliseconds(ms: number): number;
setMinutes(min: number, sec?: number, ms?: number): number;
setMonth(month: number, date?: number): number;
setSeconds(sec: number, ms?: number): number;
setTime(time: number): number;
setUTCDate(date: number): number;
setUTCFullYear(year: number, month?: number, date?: number): number;
setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;
setUTCMilliseconds(ms: number): number;
setUTCMinutes(min: number, sec?: number, ms?: number): number;
setUTCMonth(month: number, date?: number): number;
setUTCSeconds(sec: number, ms?: number): number;
toDateString(): string;
toISOString(): string;
toJSON(key?: any): string;
toLocaleDateString(): string;
toLocaleDateString(locales?: string | string[], options?: DateTimeFormatOptions): string;
toLocaleDateString(locales?: LocalesArgument, options?: DateTimeFormatOptions): string;
toLocaleString(): string;
toLocaleString(locales?: string | string[], options?: DateTimeFormatOptions): string;
toLocaleString(locales?: LocalesArgument, options?: DateTimeFormatOptions): string;
toLocaleTimeString(): string;
toLocaleTimeString(locales?: string | string[], options?: DateTimeFormatOptions): string;
toLocaleTimeString(locales?: LocalesArgument, options?: DateTimeFormatOptions): string;
toString(): string;
toTimeString(): string;
toUTCString(): string;
valueOf(): number;
}
Index
Methods
Methods
[toPrimitive]
- [to
Primitive] (hint): string Parameters
- hint: "default"
Returns string
- [to
Primitive] (hint): string Converts a Date object to a string.
Parameters
- hint: "string"
Returns string
- [to
Primitive] (hint): number Converts a Date object to a number.
Parameters
- hint: "number"
Returns number
- [to
Primitive] (hint): string | number Converts a Date object to a string or number.
Parameters
- hint: string
The strings "number", "string", or "default" to specify what primitive to return.
Returns string | number
A number if 'hint' was "number", a string if 'hint' was "string" or "default".
- hint: string
getDate
getDay
getFullYear
getHours
getMilliseconds
getMinutes
getMonth
getSeconds
getTime
getTimezoneOffset
getUTCDate
getUTCDay
getUTCFullYear
getUTCHours
getUTCMilliseconds
getUTCMinutes
getUTCMonth
getUTCSeconds
setDate
setFullYear
- set
Full (year, month?, date?): numberYear Sets the year of the Date object using local time.
Parameters
- year: number
A numeric value for the year.
Optional
month: numberA zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
Optional
date: numberA numeric value equal for the day of the month.
Returns number
- year: number
setHours
- set
Hours (hours, min?, sec?, ms?): number Sets the hour value in the Date object using local time.
Parameters
- hours: number
A numeric value equal to the hours value.
Optional
min: numberA numeric value equal to the minutes value.
Optional
sec: numberA numeric value equal to the seconds value.
Optional
ms: numberA numeric value equal to the milliseconds value.
Returns number
- hours: number
setMilliseconds
setMinutes
- set
Minutes (min, sec?, ms?): number Sets the minutes value in the Date object using local time.
Parameters
- min: number
A numeric value equal to the minutes value.
Optional
sec: numberA numeric value equal to the seconds value.
Optional
ms: numberA numeric value equal to the milliseconds value.
Returns number
- min: number
setMonth
- set
Month (month, date?): number Sets the month value in the Date object using local time.
Parameters
- month: number
A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
Optional
date: numberA numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.
Returns number
- month: number
setSeconds
setTime
setUTCDate
setUTCFullYear
- setUTCFull
Year (year, month?, date?): number Sets the year value in the Date object using Universal Coordinated Time (UTC).
Parameters
- year: number
A numeric value equal to the year.
Optional
month: numberA numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.
Optional
date: numberA numeric value equal to the day of the month.
Returns number
- year: number
setUTCHours
- setUTCHours(hours, min?, sec?, ms?): number
Sets the hours value in the Date object using Universal Coordinated Time (UTC).
Parameters
- hours: number
A numeric value equal to the hours value.
Optional
min: numberA numeric value equal to the minutes value.
Optional
sec: numberA numeric value equal to the seconds value.
Optional
ms: numberA numeric value equal to the milliseconds value.
Returns number
- hours: number
setUTCMilliseconds
setUTCMinutes
- setUTCMinutes(min, sec?, ms?): number
Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
Parameters
- min: number
A numeric value equal to the minutes value.
Optional
sec: numberA numeric value equal to the seconds value.
Optional
ms: numberA numeric value equal to the milliseconds value.
Returns number
- min: number
setUTCMonth
- setUTCMonth(month, date?): number
Sets the month value in the Date object using Universal Coordinated Time (UTC).
Parameters
- month: number
A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
Optional
date: numberA numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.
Returns number
- month: number
setUTCSeconds
toDateString
toISOString
toJSON
toLocaleDateString
- to
Locale (): stringDate String Returns a date as a string value appropriate to the host environment's current locale.
Returns string
- to
Locale (locales?, options?): stringDate String Converts a date to a string by using the current or specified locale.
Parameters
Optional
locales: string | string[]A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Returns string
- to
Locale (locales?, options?): stringDate String Converts a date to a string by using the current or specified locale.
Parameters
Optional
locales: LocalesArgumentA locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Returns string
toLocaleString
- to
Locale (): stringString Returns a value as a string value appropriate to the host environment's current locale.
Returns string
- to
Locale (locales?, options?): stringString Converts a date and time to a string by using the current or specified locale.
Parameters
Optional
locales: string | string[]A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Returns string
- to
Locale (locales?, options?): stringString Converts a date and time to a string by using the current or specified locale.
Parameters
Optional
locales: LocalesArgumentA locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Returns string
toLocaleTimeString
- to
Locale (): stringTime String Returns a time as a string value appropriate to the host environment's current locale.
Returns string
- to
Locale (locales?, options?): stringTime String Converts a time to a string by using the current or specified locale.
Parameters
Optional
locales: string | string[]A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Returns string
- to
Locale (locales?, options?): stringTime String Converts a time to a string by using the current or specified locale.
Parameters
Optional
locales: LocalesArgumentA locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
Optional
options: DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Returns string
Converts a Date object to a string.