DefinitelyTyped

Index

Variables

Interfaces

Variables

Date: Date

Enables basic storage and retrieval of dates and times.

public format(mask?: string, utc?: boolean): string

This is a convenience addition to the Date prototype Returns a formatted version of the date. The mask defaults to dateFormat.masks.default.

Parameters

  • mask?: string optional
  • utc?: boolean optional

Returns

string

public getDate(): number

Gets the day-of-the-month, using local time.

Returns

number

public getDay(): number

Gets the day of the week, using local time.

Returns

number

public getFullYear(): number

Gets the year, using local time.

Returns

number

public getHours(): number

Gets the hours in a date, using local time.

Returns

number

public getMilliseconds(): number

Gets the milliseconds of a Date, using local time.

Returns

number

public getMinutes(): number

Gets the minutes of a Date object, using local time.

Returns

number

public getMonth(): number

Gets the month, using local time.

Returns

number

public getSeconds(): number

Gets the seconds of a Date object, using local time.

Returns

number

public getTime(): number

Gets the time value in milliseconds.

Returns

number

public getTimezoneOffset(): number

Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC).

Returns

number

public getUTCDate(): number

Gets the day-of-the-month, using Universal Coordinated Time (UTC).

Returns

number

public getUTCDay(): number

Gets the day of the week using Universal Coordinated Time (UTC).

Returns

number

public getUTCFullYear(): number

Gets the year using Universal Coordinated Time (UTC).

Returns

number

public getUTCHours(): number

Gets the hours value in a Date object using Universal Coordinated Time (UTC).

Returns

number

public getUTCMilliseconds(): number

Gets the milliseconds of a Date object using Universal Coordinated Time (UTC).

Returns

number

public getUTCMinutes(): number

Gets the minutes of a Date object using Universal Coordinated Time (UTC).

Returns

number

public getUTCMonth(): number

Gets the month of a Date object using Universal Coordinated Time (UTC).

Returns

number

public getUTCSeconds(): number

Gets the seconds of a Date object using Universal Coordinated Time (UTC).

Returns

number

public setDate(date: number)

Sets the numeric day-of-the-month value of the Date object using local time.

Parameters

  • date: number

    A numeric value equal to the day of the month.

public setFullYear(year: number, month?: number, date?: number)

Sets the year of the Date object using local time.

Parameters

  • year: number

    A numeric value for the year.

  • month?: number optional

    A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.

  • date?: number optional

    A numeric value equal for the day of the month.

public setHours(hours: number, min?: number, sec?: number, ms?: number)

Sets the hour value in the Date object using local time.

Parameters

  • hours: number

    A numeric value equal to the hours value.

  • min?: number optional

    A numeric value equal to the minutes value.

  • sec?: number optional

    A numeric value equal to the seconds value.

  • ms?: number optional

    A numeric value equal to the milliseconds value.

public setMilliseconds(ms: number)

Sets the milliseconds value in the Date object using local time.

Parameters

  • ms: number

    A numeric value equal to the millisecond value.

public setMinutes(min: number, sec?: number, ms?: number)

Sets the minutes value in the Date object using local time.

Parameters

  • min: number

    A numeric value equal to the minutes value.

  • sec?: number optional

    A numeric value equal to the seconds value.

  • ms?: number optional

    A numeric value equal to the milliseconds value.

public setMonth(month: number, 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.

  • date?: number optional

    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.

public setSeconds(sec: number, ms?: number)

Sets the seconds value in the Date object using local time.

Parameters

  • sec: number

    A numeric value equal to the seconds value.

  • ms?: number optional

    A numeric value equal to the milliseconds value.

public setTime(time: number)

Sets the date and time value in the Date object.

Parameters

  • time: number

    A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.

public setUTCDate(date: number)

Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).

Parameters

  • date: number

    A numeric value equal to the day of the month.

public setUTCFullYear(year: number, month?: number, 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.

  • month?: number optional

    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 optional

    A numeric value equal to the day of the month.

public setUTCHours(hours: number, min?: number, sec?: number, 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.

  • min?: number optional

    A numeric value equal to the minutes value.

  • sec?: number optional

    A numeric value equal to the seconds value.

  • ms?: number optional

    A numeric value equal to the milliseconds value.

public setUTCMilliseconds(ms: number)

Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).

Parameters

  • ms: number

    A numeric value equal to the millisecond value.

public setUTCMinutes(min: number, sec?: number, 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.

  • sec?: number optional

    A numeric value equal to the seconds value.

  • ms?: number optional

    A numeric value equal to the milliseconds value.

public setUTCMonth(month: number, 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.

  • date?: number optional

    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.

public setUTCSeconds(sec: number, ms?: number)

Sets the seconds value in the Date object using Universal Coordinated Time (UTC).

Parameters

  • sec: number

    A numeric value equal to the seconds value.

  • ms?: number optional

    A numeric value equal to the milliseconds value.

public toDateString(): string

Returns a date as a string value.

Returns

string

public toISOString(): string

Returns a date as a string value in ISO format.

Returns

string

public toJSON(key?: any): string

Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.

Parameters

  • key?: any optional

Returns

string

public toLocaleDateString(): string

Returns a date as a string value appropriate to the host environment's current locale.

Returns

string

public toLocaleString(): string

Returns a value as a string value appropriate to the host environment's current locale.

Returns

string

public toLocaleTimeString(): string

Returns a time as a string value appropriate to the host environment's current locale.

Returns

string

public toString(): string

Returns a string representation of a date. The format of the string depends on the locale.

Returns

string

public toTimeString(): string

Returns a time as a string value.

Returns

string

public toUTCString(): string

Returns a date converted to a string using Universal Coordinated Time (UTC).

Returns

string

public valueOf(): number

Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC.

Returns

number

dateFormat: { masks: DateFormatMasks; i18n: DateFormatI18n; (date?: any, mask?: string, utc?: boolean): string; }

Accepts a date, a mask, or a date and a mask. Returns a formatted version of the given date. The date defaults to the current date/time. The mask defaults to dateFormat.masks.default.

param
param
param

(): string

Returns

string

public dateFormat.i18n: DateFormatI18n

public dateFormat.masks: DateFormatMasks