DateTime class that adds micro and nanoseconds.
DateTime
new DateTime(): DateTime
DateTime
new DateTime(value: string | number): DateTime
DateTime
new DateTime(year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): DateTime
Creates a new Date.
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).date?: number
The date as a number between 1 and 31.hours?: number
Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.minutes?: number
Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.seconds?: number
Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.ms?: number
A number from 0 to 999 that specifies the milliseconds.DateTime
new DateTime(value: string | number | Date): DateTime
DateTime
makeLocalDateTime(year: number, month: number, day: number, resolution: number, secondsInDay: number, subSecond: number): DateTime
DateTime
makeUtcDateTime(year: number, month: number, day: number, resolution: number, secondsInDay: number, subSecond: number): DateTime
DateTime
fromJSON(json: any): DateTime
Make a DateTime from JSON from DateTime.toJSON().
DateTime
parse(s: string): number
Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
s: string
A date stringnumber
UTC(year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number
Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
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).date?: number
The date as a number between 1 and 31.hours?: number
Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.minutes?: number
Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.seconds?: number
Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.ms?: number
A number from 0 to 999 that specifies the milliseconds.number
now(): number
Returns the number of milliseconds elapsed since midnight, January 1, 1970 Universal Coordinated Time (UTC).
number
toString(): string
string
toLocaleString(): string
string
getMicroseconds(): undefined | number
undefined | number
getNanoseconds(): undefined | number
undefined | number
toJSON(): any
any
dateToString(): string
string
timeToString(): string
string
setLocalTime(resolution: number, secondsInDay: number, subSecond: number): void
void
setUtcTime(resolution: number, secondsInDay: number, subSecond: number): void
void
toDateString(): string
Returns a date as a string value.
string
toTimeString(): string
Returns a time as a string value.
string
toLocaleDateString(): string
Returns a date as a string value appropriate to the host environment's current locale.
string
toLocaleDateString(locales?: string | string[], options?: DateTimeFormatOptions): string
Converts a date to a string by using the current or specified locale.
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.options?: DateTimeFormatOptions
An object that contains one or more properties that specify comparison options.string
toLocaleDateString(locales?: LocalesArgument, options?: DateTimeFormatOptions): string
Converts a date to a string by using the current or specified locale.
locales?: LocalesArgument
A 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.options?: DateTimeFormatOptions
An object that contains one or more properties that specify comparison options.string
toLocaleTimeString(): string
Returns a time as a string value appropriate to the host environment's current locale.
string
toLocaleTimeString(locales?: string | string[], options?: DateTimeFormatOptions): string
Converts a time to a string by using the current or specified locale.
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.options?: DateTimeFormatOptions
An object that contains one or more properties that specify comparison options.string
toLocaleTimeString(locales?: LocalesArgument, options?: DateTimeFormatOptions): string
Converts a time to a string by using the current or specified locale.
locales?: LocalesArgument
A 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.options?: DateTimeFormatOptions
An object that contains one or more properties that specify comparison options.string
valueOf(): number
Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC.
number
getTime(): number
Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC.
number
getFullYear(): number
Gets the year, using local time.
number
getUTCFullYear(): number
Gets the year using Universal Coordinated Time (UTC).
number
getMonth(): number
Gets the month, using local time.
number
getUTCMonth(): number
Gets the month of a Date object using Universal Coordinated Time (UTC).
number
getDate(): number
Gets the day-of-the-month, using local time.
number
getUTCDate(): number
Gets the day-of-the-month, using Universal Coordinated Time (UTC).
number
getDay(): number
Gets the day of the week, using local time.
number
getUTCDay(): number
Gets the day of the week using Universal Coordinated Time (UTC).
number
getHours(): number
Gets the hours in a date, using local time.
number
getUTCHours(): number
Gets the hours value in a Date object using Universal Coordinated Time (UTC).
number
getMinutes(): number
Gets the minutes of a Date object, using local time.
number
getUTCMinutes(): number
Gets the minutes of a Date object using Universal Coordinated Time (UTC).
number
getSeconds(): number
Gets the seconds of a Date object, using local time.
number
getUTCSeconds(): number
Gets the seconds of a Date object using Universal Coordinated Time (UTC).
number
getMilliseconds(): number
Gets the milliseconds of a Date, using local time.
number
getUTCMilliseconds(): number
Gets the milliseconds of a Date object using Universal Coordinated Time (UTC).
number
getTimezoneOffset(): number
Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC).
number
setTime(time: number): number
Sets the date and time value in the Date object.
time: number
A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.number
setMilliseconds(ms: number): number
Sets the milliseconds value in the Date object using local time.
ms: number
A numeric value equal to the millisecond value.number
setUTCMilliseconds(ms: number): number
Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
ms: number
A numeric value equal to the millisecond value.number
setSeconds(sec: number, ms?: number): number
Sets the seconds value in the Date object using local time.
sec: number
A numeric value equal to the seconds value.ms?: number
A numeric value equal to the milliseconds value.number
setUTCSeconds(sec: number, ms?: number): number
Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
sec: number
A numeric value equal to the seconds value.ms?: number
A numeric value equal to the milliseconds value.number
setMinutes(min: number, sec?: number, ms?: number): number
Sets the minutes value in the Date object using local time.
min: number
A numeric value equal to the minutes value.sec?: number
A numeric value equal to the seconds value.ms?: number
A numeric value equal to the milliseconds value.number
setUTCMinutes(min: number, sec?: number, ms?: number): number
Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
min: number
A numeric value equal to the minutes value.sec?: number
A numeric value equal to the seconds value.ms?: number
A numeric value equal to the milliseconds value.number
setHours(hours: number, min?: number, sec?: number, ms?: number): number
Sets the hour value in the Date object using local time.
hours: number
A numeric value equal to the hours value.min?: number
A numeric value equal to the minutes value.sec?: number
A numeric value equal to the seconds value.ms?: number
A numeric value equal to the milliseconds value.number
setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number
Sets the hours value in the Date object using Universal Coordinated Time (UTC).
hours: number
A numeric value equal to the hours value.min?: number
A numeric value equal to the minutes value.sec?: number
A numeric value equal to the seconds value.ms?: number
A numeric value equal to the milliseconds value.number
setDate(date: number): number
Sets the numeric day-of-the-month value of the Date object using local time.
date: number
A numeric value equal to the day of the month.number
setUTCDate(date: number): number
Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
date: number
A numeric value equal to the day of the month.number
setMonth(month: number, date?: number): number
Sets the month value in the Date object using local time.
month: number
A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.date?: number
A 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.number
setUTCMonth(month: number, date?: number): number
Sets the month value in the Date object using Universal Coordinated Time (UTC).
month: number
A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.date?: number
A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.number
setFullYear(year: number, month?: number, date?: number): number
Sets the year of the Date object using local time.
year: number
A numeric value for the year.month?: number
A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.date?: number
A numeric value equal for the day of the month.number
setUTCFullYear(year: number, month?: number, date?: number): number
Sets the year value in the Date object using Universal Coordinated Time (UTC).
year: number
A numeric value equal to the year.month?: number
A 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.date?: number
A numeric value equal to the day of the month.number
toUTCString(): string
Returns a date converted to a string using Universal Coordinated Time (UTC).
string
toISOString(): string
Returns a date as a string value in ISO format.
string
[toPrimitive](hint: literal default): string
Converts a Date object to a string.
string
[toPrimitive](hint: literal string): string
Converts a Date object to a string.
string
[toPrimitive](hint: literal number): number
Converts a Date object to a number.
number
[toPrimitive](hint: string): string | number
Converts a Date object to a string or number.
hint: string
The strings "number", "string", or "default" to specify what primitive to return.string | number
microseconds?: number
nanoseconds?: number