Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link

@fuel-ts/utils v0.94.9 Docs


Icon LinkClass: DateTime

This class is used to represent a date and time in the Tai64 format.

import { DateTime } from 'fuels';
 
// Constants
const tai64 = '4611686020108779340';
const unixMilliseconds = 1681391398000;
const seconds = 1681391398;
 
// Instantiation
let date: DateTime = DateTime.now();
date = DateTime.fromTai64(tai64);
date = DateTime.fromUnixMilliseconds(unixMilliseconds);
date = DateTime.fromUnixSeconds(seconds);
 
// Utility functions
tai64.toTai64() // '4611686020108779340'
milliseconds.toUnixMilliseconds() // 1681391398000
seconds.toUnixSeconds() // 1681391398
 
// All date methods are available
const now: Date = DateTime.now();
now.toISOString(); // '2023-04-13T13:09:58.000Z'
now.getTime(); // 1681391398000

Icon LinkExtends

  • Date

Icon LinkImplements

  • Date

Icon LinkProperties

Icon LinkTAI64_NULL

Icon InfoCircle

static TAI64_NULL: string = ''

Icon LinkDefined in

packages/utils/src/utils/date-time.ts:99 Icon Link

Icon LinkMethods

Icon Link[toPrimitive]()

Icon Link[toPrimitive](hint)

Icon InfoCircle

[toPrimitive](hint): string

Converts a Date object to a string.

Icon LinkParameters

hint: "default"

Icon LinkReturns

string

Icon LinkImplementation of

Date.[toPrimitive]

Icon LinkInherited from

Date.[toPrimitive]

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:116

Icon Link[toPrimitive](hint)

Icon InfoCircle

[toPrimitive](hint): string

Converts a Date object to a string.

Icon LinkParameters

hint: "string"

Icon LinkReturns

string

Icon LinkImplementation of

Date.[toPrimitive]

Icon LinkInherited from

Date.[toPrimitive]

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:120

Icon Link[toPrimitive](hint)

Icon InfoCircle

[toPrimitive](hint): number

Converts a Date object to a number.

Icon LinkParameters

hint: "number"

Icon LinkReturns

number

Icon LinkImplementation of

Date.[toPrimitive]

Icon LinkInherited from

Date.[toPrimitive]

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:124

Icon Link[toPrimitive](hint)

Icon InfoCircle

[toPrimitive](hint): string | number

Converts a Date object to a string or number.

Icon LinkParameters

hint: string

The strings "number", "string", or "default" to specify what primitive to return.

Icon LinkReturns

string | number

A number if 'hint' was "number", a string if 'hint' was "string" or "default".

Icon LinkThrows

If 'hint' was given something other than "number", "string", or "default".

Icon LinkImplementation of

Date.[toPrimitive]

Icon LinkInherited from

Date.[toPrimitive]

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:133


Icon LinkgetDate()

Icon InfoCircle

getDate(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getDate

Icon LinkInherited from

Date.getDate

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:798


Icon LinkgetDay()

Icon InfoCircle

getDay(): number

Gets the day of the week, using local time.

Icon LinkReturns

number

Icon LinkImplementation of

Date.getDay

Icon LinkInherited from

Date.getDay

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:802


Icon LinkgetFullYear()

Icon InfoCircle

getFullYear(): number

Gets the year, using local time.

Icon LinkReturns

number

Icon LinkImplementation of

Date.getFullYear

Icon LinkInherited from

Date.getFullYear

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:790


Icon LinkgetHours()

Icon InfoCircle

getHours(): number

Gets the hours in a date, using local time.

Icon LinkReturns

number

Icon LinkImplementation of

Date.getHours

Icon LinkInherited from

Date.getHours

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:806


Icon LinkgetMilliseconds()

Icon InfoCircle

getMilliseconds(): number

Gets the milliseconds of a Date, using local time.

Icon LinkReturns

number

Icon LinkImplementation of

Date.getMilliseconds

Icon LinkInherited from

Date.getMilliseconds

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:818


Icon LinkgetMinutes()

Icon InfoCircle

getMinutes(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getMinutes

Icon LinkInherited from

Date.getMinutes

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:810


Icon LinkgetMonth()

Icon InfoCircle

getMonth(): number

Gets the month, using local time.

Icon LinkReturns

number

Icon LinkImplementation of

Date.getMonth

Icon LinkInherited from

Date.getMonth

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:794


Icon LinkgetSeconds()

Icon InfoCircle

getSeconds(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getSeconds

Icon LinkInherited from

Date.getSeconds

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:814


Icon LinkgetTime()

Icon InfoCircle

getTime(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getTime

Icon LinkInherited from

Date.getTime

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:788


Icon LinkgetTimezoneOffset()

Icon InfoCircle

getTimezoneOffset(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getTimezoneOffset

Icon LinkInherited from

Date.getTimezoneOffset

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:822


Icon LinkgetUTCDate()

Icon InfoCircle

getUTCDate(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getUTCDate

Icon LinkInherited from

Date.getUTCDate

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:800


Icon LinkgetUTCDay()

Icon InfoCircle

getUTCDay(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getUTCDay

Icon LinkInherited from

Date.getUTCDay

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:804


Icon LinkgetUTCFullYear()

Icon InfoCircle

getUTCFullYear(): number

Gets the year using Universal Coordinated Time (UTC).

Icon LinkReturns

number

Icon LinkImplementation of

Date.getUTCFullYear

Icon LinkInherited from

Date.getUTCFullYear

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:792


Icon LinkgetUTCHours()

Icon InfoCircle

getUTCHours(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getUTCHours

Icon LinkInherited from

Date.getUTCHours

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:808


Icon LinkgetUTCMilliseconds()

Icon InfoCircle

getUTCMilliseconds(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getUTCMilliseconds

Icon LinkInherited from

Date.getUTCMilliseconds

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:820


Icon LinkgetUTCMinutes()

Icon InfoCircle

getUTCMinutes(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getUTCMinutes

Icon LinkInherited from

Date.getUTCMinutes

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:812


Icon LinkgetUTCMonth()

Icon InfoCircle

getUTCMonth(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getUTCMonth

Icon LinkInherited from

Date.getUTCMonth

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:796


Icon LinkgetUTCSeconds()

Icon InfoCircle

getUTCSeconds(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getUTCSeconds

Icon LinkInherited from

Date.getUTCSeconds

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:816


Icon LinksetDate()

Icon InfoCircle

setDate(date): number

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

Icon LinkParameters

date: number

A numeric value equal to the day of the month.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setDate

Icon LinkInherited from

Date.setDate

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:885


Icon LinksetFullYear()

Icon InfoCircle

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

Sets the year of the Date object using local time.

Icon LinkParameters

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.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setFullYear

Icon LinkInherited from

Date.setFullYear

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:909


Icon LinksetHours()

Icon InfoCircle

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

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

Icon LinkParameters

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.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setHours

Icon LinkInherited from

Date.setHours

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:872


Icon LinksetMilliseconds()

Icon InfoCircle

setMilliseconds(ms): number

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

Icon LinkParameters

ms: number

A numeric value equal to the millisecond value.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setMilliseconds

Icon LinkInherited from

Date.setMilliseconds

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:832


Icon LinksetMinutes()

Icon InfoCircle

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

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

Icon LinkParameters

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.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setMinutes

Icon LinkInherited from

Date.setMinutes

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:857


Icon LinksetMonth()

Icon InfoCircle

setMonth(month, date?): number

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

Icon LinkParameters

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.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setMonth

Icon LinkInherited from

Date.setMonth

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:896


Icon LinksetSeconds()

Icon InfoCircle

setSeconds(sec, ms?): number

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

Icon LinkParameters

sec: number

A numeric value equal to the seconds value.

ms?: number

A numeric value equal to the milliseconds value.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setSeconds

Icon LinkInherited from

Date.setSeconds

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:844


Icon LinksetTime()

Icon InfoCircle

setTime(time): number

Sets the date and time value in the Date object.

Icon LinkParameters

time: number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.setTime

Icon LinkInherited from

Date.setTime

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:827


Icon LinksetUTCDate()

Icon InfoCircle

setUTCDate(date): number

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

Icon LinkParameters

date: number

A numeric value equal to the day of the month.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setUTCDate

Icon LinkInherited from

Date.setUTCDate

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:890


Icon LinksetUTCFullYear()

Icon InfoCircle

setUTCFullYear(year, month?, date?): number

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

Icon LinkParameters

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.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setUTCFullYear

Icon LinkInherited from

Date.setUTCFullYear

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:916


Icon LinksetUTCHours()

Icon InfoCircle

setUTCHours(hours, min?, sec?, ms?): number

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

Icon LinkParameters

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.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setUTCHours

Icon LinkInherited from

Date.setUTCHours

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:880


Icon LinksetUTCMilliseconds()

Icon InfoCircle

setUTCMilliseconds(ms): number

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

Icon LinkParameters

ms: number

A numeric value equal to the millisecond value.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setUTCMilliseconds

Icon LinkInherited from

Date.setUTCMilliseconds

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:837


Icon LinksetUTCMinutes()

Icon InfoCircle

setUTCMinutes(min, sec?, ms?): number

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

Icon LinkParameters

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.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setUTCMinutes

Icon LinkInherited from

Date.setUTCMinutes

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:864


Icon LinksetUTCMonth()

Icon InfoCircle

setUTCMonth(month, date?): number

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

Icon LinkParameters

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.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setUTCMonth

Icon LinkInherited from

Date.setUTCMonth

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:902


Icon LinksetUTCSeconds()

Icon InfoCircle

setUTCSeconds(sec, ms?): number

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

Icon LinkParameters

sec: number

A numeric value equal to the seconds value.

ms?: number

A numeric value equal to the milliseconds value.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setUTCSeconds

Icon LinkInherited from

Date.setUTCSeconds

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:850


Icon LinktoDateString()

Icon InfoCircle

toDateString(): string

Returns a date as a string value.

Icon LinkReturns

string

Icon LinkImplementation of

Date.toDateString

Icon LinkInherited from

Date.toDateString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:776


Icon LinktoISOString()

Icon InfoCircle

toISOString(): string

Returns a date as a string value in ISO format.

Icon LinkReturns

string

Icon LinkImplementation of

Date.toISOString

Icon LinkInherited from

Date.toISOString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:920


Icon LinktoJSON()

Icon InfoCircle

toJSON(key?): string

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

Icon LinkParameters

key?: any

Icon LinkReturns

string

Icon LinkImplementation of

Date.toJSON

Icon LinkInherited from

Date.toJSON

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:922


Icon LinktoLocaleDateString()

Icon LinktoLocaleDateString(undefined)

Icon InfoCircle

toLocaleDateString(): string

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

Icon LinkReturns

string

Icon LinkImplementation of

Date.toLocaleDateString

Icon LinkInherited from

Date.toLocaleDateString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:782

Icon LinktoLocaleDateString(locales, options)

Icon InfoCircle

toLocaleDateString(locales?, options?): string

Converts a date to a string by using the current or specified locale.

Icon LinkParameters

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.

Icon LinkReturns

string

Icon LinkImplementation of

Date.toLocaleDateString

Icon LinkInherited from

Date.toLocaleDateString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:4577

Icon LinktoLocaleDateString(locales, options)

Icon InfoCircle

toLocaleDateString(locales?, options?): string

Converts a date to a string by using the current or specified locale.

Icon LinkParameters

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.

Icon LinkReturns

string

Icon LinkImplementation of

Date.toLocaleDateString

Icon LinkInherited from

Date.toLocaleDateString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es2020.date.d.ts:34


Icon LinktoLocaleString()

Icon LinktoLocaleString(undefined)

Icon InfoCircle

toLocaleString(): string

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

Icon LinkReturns

string

Icon LinkImplementation of

Date.toLocaleString

Icon LinkInherited from

Date.toLocaleString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:780

Icon LinktoLocaleString(locales, options)

Icon InfoCircle

toLocaleString(locales?, options?): string

Converts a date and time to a string by using the current or specified locale.

Icon LinkParameters

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.

Icon LinkReturns

string

Icon LinkImplementation of

Date.toLocaleString

Icon LinkInherited from

Date.toLocaleString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:4571

Icon LinktoLocaleString(locales, options)

Icon InfoCircle

toLocaleString(locales?, options?): string

Converts a date and time to a string by using the current or specified locale.

Icon LinkParameters

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.

Icon LinkReturns

string

Icon LinkImplementation of

Date.toLocaleString

Icon LinkInherited from

Date.toLocaleString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es2020.date.d.ts:27


Icon LinktoLocaleTimeString()

Icon LinktoLocaleTimeString(undefined)

Icon InfoCircle

toLocaleTimeString(): string

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

Icon LinkReturns

string

Icon LinkImplementation of

Date.toLocaleTimeString

Icon LinkInherited from

Date.toLocaleTimeString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:784

Icon LinktoLocaleTimeString(locales, options)

Icon InfoCircle

toLocaleTimeString(locales?, options?): string

Converts a time to a string by using the current or specified locale.

Icon LinkParameters

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.

Icon LinkReturns

string

Icon LinkImplementation of

Date.toLocaleTimeString

Icon LinkInherited from

Date.toLocaleTimeString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:4584

Icon LinktoLocaleTimeString(locales, options)

Icon InfoCircle

toLocaleTimeString(locales?, options?): string

Converts a time to a string by using the current or specified locale.

Icon LinkParameters

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.

Icon LinkReturns

string

Icon LinkImplementation of

Date.toLocaleTimeString

Icon LinkInherited from

Date.toLocaleTimeString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es2020.date.d.ts:41


Icon LinktoString()

Icon InfoCircle

toString(): string

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

Icon LinkReturns

string

Icon LinkImplementation of

Date.toString

Icon LinkInherited from

Date.toString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:774


Icon LinktoTai64()

Icon InfoCircle

toTai64(): string

Returns the Tai64 timestamp.

Icon LinkReturns

string

the Tai64 timestamp

Icon LinkDefined in

packages/utils/src/utils/date-time.ts:139 Icon Link


Icon LinktoTimeString()

Icon InfoCircle

toTimeString(): string

Returns a time as a string value.

Icon LinkReturns

string

Icon LinkImplementation of

Date.toTimeString

Icon LinkInherited from

Date.toTimeString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:778


Icon LinktoUTCString()

Icon InfoCircle

toUTCString(): string

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

Icon LinkReturns

string

Icon LinkImplementation of

Date.toUTCString

Icon LinkInherited from

Date.toUTCString

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:918


Icon LinktoUnixMilliseconds()

Icon InfoCircle

toUnixMilliseconds(): number

Icon LinkReturns

number

the unix milliseconds timestamp

Icon LinkDefined in

packages/utils/src/utils/date-time.ts:146 Icon Link


Icon LinktoUnixSeconds()

Icon InfoCircle

toUnixSeconds(): number

Icon LinkReturns

number

the unix seconds timestamp

Icon LinkDefined in

packages/utils/src/utils/date-time.ts:153 Icon Link


Icon LinkvalueOf()

Icon InfoCircle

valueOf(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.valueOf

Icon LinkInherited from

Date.valueOf

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:786


Icon LinkUTC()

Icon LinkUTC(year, monthIndex, date, hours, minutes, seconds, ms)

Icon InfoCircle

static 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.

Icon LinkParameters

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.

Icon LinkReturns

number

Icon LinkInherited from

Date.UTC

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:956

Icon LinkUTC(year, monthIndex, date, hours, minutes, seconds, ms)

Icon InfoCircle

static 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.

Icon LinkParameters

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.

Icon LinkReturns

number

Icon LinkInherited from

Date.UTC

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es2017.date.d.ts:30


Icon LinkfromTai64()

Icon InfoCircle

static fromTai64(tai64): DateTime

Generates a new DateTime instance from a Tai64 timestamp.

Icon LinkParameters

tai64: string

Tai64 timestamp

Icon LinkReturns

DateTime

a new DateTime instance

Icon LinkDefined in

packages/utils/src/utils/date-time.ts:107 Icon Link


Icon LinkfromUnixMilliseconds()

Icon InfoCircle

static fromUnixMilliseconds(unixMilliseconds): DateTime

Icon LinkParameters

unixMilliseconds: number

unix milliseconds timestamp

Icon LinkReturns

DateTime

a new DateTime instance

Icon LinkDefined in

packages/utils/src/utils/date-time.ts:115 Icon Link


Icon LinkfromUnixSeconds()

Icon InfoCircle

static fromUnixSeconds(unixSeconds): DateTime

Icon LinkParameters

unixSeconds: number

unix seconds timestamp

Icon LinkReturns

DateTime

a new DateTime instance

Icon LinkDefined in

packages/utils/src/utils/date-time.ts:123 Icon Link


Icon Linknow()

Icon InfoCircle

static now(): number

Returns the number of milliseconds elapsed since midnight, January 1, 1970 Universal Coordinated Time (UTC).

Icon LinkReturns

number

Icon LinkInherited from

Date.now

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:958


Icon Linkparse()

Icon InfoCircle

static parse(s): number

Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.

Icon LinkParameters

s: string

A date string

Icon LinkReturns

number

Icon LinkInherited from

Date.parse

Icon LinkDefined in

node_modules/.pnpm/typescript@5.6.2/node_modules/typescript/lib/lib.es5.d.ts:945