Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link

Icon LinkClass: DateTime

@fuel-ts/utils .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 LinkHierarchy

  • Date

    DateTime

Icon LinkImplements

  • Date

Icon LinkConstructors

Icon Linkconstructor

new DateTime(date): DateTime

Hide the constructor to prevent direct instantiation.

Icon LinkParameters

NameType
datestring | number | Date

Icon LinkReturns

DateTime

Icon LinkOverrides

Date.constructor

Icon LinkDefined in

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

Icon LinkProperties

Icon LinkTAI64_NULL

Static TAI64_NULL: string = ''

Icon LinkDefined in

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

Icon LinkMethods

Icon Link[toPrimitive]

[toPrimitive](hint): string

Converts a Date object to a string.

Icon LinkParameters

NameType
hint"default"

Icon LinkReturns

string

Icon LinkImplementation of

Date.[toPrimitive]

Icon LinkInherited from

Date.[toPrimitive]

Icon LinkDefined in

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

[toPrimitive](hint): string

Converts a Date object to a string.

Icon LinkParameters

NameType
hint"string"

Icon LinkReturns

string

Icon LinkImplementation of

Date.[toPrimitive]

Icon LinkInherited from

Date.[toPrimitive]

Icon LinkDefined in

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

[toPrimitive](hint): number

Converts a Date object to a number.

Icon LinkParameters

NameType
hint"number"

Icon LinkReturns

number

Icon LinkImplementation of

Date.[toPrimitive]

Icon LinkInherited from

Date.[toPrimitive]

Icon LinkDefined in

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

[toPrimitive](hint): string | number

Converts a Date object to a string or number.

Throws

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

Icon LinkParameters

NameTypeDescription
hintstringThe 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 LinkImplementation of

Date.[toPrimitive]

Icon LinkInherited from

Date.[toPrimitive]

Icon LinkDefined in

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


Icon LinkgetDate

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:789


Icon LinkgetDay

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:793


Icon LinkgetFullYear

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:781


Icon LinkgetHours

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:797


Icon LinkgetMilliseconds

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:809


Icon LinkgetMinutes

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:801


Icon LinkgetMonth

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:785


Icon LinkgetSeconds

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:805


Icon LinkgetTime

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:779


Icon LinkgetTimezoneOffset

getTimezoneOffset(): number

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

Icon LinkReturns

number

Icon LinkImplementation of

Date.getTimezoneOffset

Icon LinkInherited from

Date.getTimezoneOffset

Icon LinkDefined in

node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es5.d.ts:813


Icon LinkgetUTCDate

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:791


Icon LinkgetUTCDay

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:795


Icon LinkgetUTCFullYear

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:783


Icon LinkgetUTCHours

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:799


Icon LinkgetUTCMilliseconds

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:811


Icon LinkgetUTCMinutes

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:803


Icon LinkgetUTCMonth

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:787


Icon LinkgetUTCSeconds

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:807


Icon LinksetDate

setDate(date): number

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

Icon LinkParameters

NameTypeDescription
datenumberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:876


Icon LinksetFullYear

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

Sets the year of the Date object using local time.

Icon LinkParameters

NameTypeDescription
yearnumberA numeric value for the year.
month?numberA zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
date?numberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:900


Icon LinksetHours

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

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

Icon LinkParameters

NameTypeDescription
hoursnumberA numeric value equal to the hours value.
min?numberA numeric value equal to the minutes value.
sec?numberA numeric value equal to the seconds value.
ms?numberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:863


Icon LinksetMilliseconds

setMilliseconds(ms): number

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

Icon LinkParameters

NameTypeDescription
msnumberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:823


Icon LinksetMinutes

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

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

Icon LinkParameters

NameTypeDescription
minnumberA numeric value equal to the minutes value.
sec?numberA numeric value equal to the seconds value.
ms?numberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:848


Icon LinksetMonth

setMonth(month, date?): number

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

Icon LinkParameters

NameTypeDescription
monthnumberA numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
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.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setMonth

Icon LinkInherited from

Date.setMonth

Icon LinkDefined in

node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es5.d.ts:887


Icon LinksetSeconds

setSeconds(sec, ms?): number

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

Icon LinkParameters

NameTypeDescription
secnumberA numeric value equal to the seconds value.
ms?numberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:835


Icon LinksetTime

setTime(time): number

Sets the date and time value in the Date object.

Icon LinkParameters

NameTypeDescription
timenumberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:818


Icon LinksetUTCDate

setUTCDate(date): number

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

Icon LinkParameters

NameTypeDescription
datenumberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:881


Icon LinksetUTCFullYear

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

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

Icon LinkParameters

NameTypeDescription
yearnumberA numeric value equal to the year.
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.
date?numberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:907


Icon LinksetUTCHours

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

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

Icon LinkParameters

NameTypeDescription
hoursnumberA numeric value equal to the hours value.
min?numberA numeric value equal to the minutes value.
sec?numberA numeric value equal to the seconds value.
ms?numberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:871


Icon LinksetUTCMilliseconds

setUTCMilliseconds(ms): number

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

Icon LinkParameters

NameTypeDescription
msnumberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:828


Icon LinksetUTCMinutes

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

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

Icon LinkParameters

NameTypeDescription
minnumberA numeric value equal to the minutes value.
sec?numberA numeric value equal to the seconds value.
ms?numberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:855


Icon LinksetUTCMonth

setUTCMonth(month, date?): number

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

Icon LinkParameters

NameTypeDescription
monthnumberA numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
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.

Icon LinkReturns

number

Icon LinkImplementation of

Date.setUTCMonth

Icon LinkInherited from

Date.setUTCMonth

Icon LinkDefined in

node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es5.d.ts:893


Icon LinksetUTCSeconds

setUTCSeconds(sec, ms?): number

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

Icon LinkParameters

NameTypeDescription
secnumberA numeric value equal to the seconds value.
ms?numberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:841


Icon LinktoDateString

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:767


Icon LinktoISOString

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:911


Icon LinktoJSON

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

NameType
key?any

Icon LinkReturns

string

Icon LinkImplementation of

Date.toJSON

Icon LinkInherited from

Date.toJSON

Icon LinkDefined in

node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es5.d.ts:913


Icon LinktoLocaleDateString

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:773

toLocaleDateString(locales?, options?): string

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

Icon LinkParameters

NameTypeDescription
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?DateTimeFormatOptionsAn 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:4546

toLocaleDateString(locales?, options?): string

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

Icon LinkParameters

NameTypeDescription
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.
options?DateTimeFormatOptionsAn 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.2.2/node_modules/typescript/lib/lib.es2020.date.d.ts:34


Icon LinktoLocaleString

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:771

toLocaleString(locales?, options?): string

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

Icon LinkParameters

NameTypeDescription
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?DateTimeFormatOptionsAn 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:4540

toLocaleString(locales?, options?): string

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

Icon LinkParameters

NameTypeDescription
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.
options?DateTimeFormatOptionsAn 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.2.2/node_modules/typescript/lib/lib.es2020.date.d.ts:27


Icon LinktoLocaleTimeString

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:775

toLocaleTimeString(locales?, options?): string

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

Icon LinkParameters

NameTypeDescription
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?DateTimeFormatOptionsAn 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:4553

toLocaleTimeString(locales?, options?): string

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

Icon LinkParameters

NameTypeDescription
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.
options?DateTimeFormatOptionsAn 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.2.2/node_modules/typescript/lib/lib.es2020.date.d.ts:41


Icon LinktoString

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:765


Icon LinktoTai64

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

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:769


Icon LinktoUTCString

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:909


Icon LinktoUnixMilliseconds

toUnixMilliseconds(): number

Icon LinkReturns

number

the unix milliseconds timestamp

Icon LinkDefined in

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


Icon LinktoUnixSeconds

toUnixSeconds(): number

Icon LinkReturns

number

the unix seconds timestamp

Icon LinkDefined in

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


Icon LinkvalueOf

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:777


Icon LinkUTC

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

NameTypeDescription
yearnumberThe 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.
monthIndexnumberThe month as a number between 0 and 11 (January to December).
date?numberThe date as a number between 1 and 31.
hours?numberMust be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
minutes?numberMust be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
seconds?numberMust be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
ms?numberA 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.2.2/node_modules/typescript/lib/lib.es5.d.ts:947

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

NameTypeDescription
yearnumberThe 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?numberThe month as a number between 0 and 11 (January to December).
date?numberThe date as a number between 1 and 31.
hours?numberMust be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
minutes?numberMust be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
seconds?numberMust be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
ms?numberA 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.2.2/node_modules/typescript/lib/lib.es2017.date.d.ts:30


Icon LinkfromTai64

fromTai64(tai64): DateTime

Generates a new DateTime instance from a Tai64 timestamp.

Icon LinkParameters

NameTypeDescription
tai64stringTai64 timestamp

Icon LinkReturns

DateTime

a new DateTime instance

Icon LinkDefined in

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


Icon LinkfromUnixMilliseconds

fromUnixMilliseconds(unixMilliseconds): DateTime

Icon LinkParameters

NameTypeDescription
unixMillisecondsnumberunix milliseconds timestamp

Icon LinkReturns

DateTime

a new DateTime instance

Icon LinkDefined in

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


Icon LinkfromUnixSeconds

fromUnixSeconds(unixSeconds): DateTime

Icon LinkParameters

NameTypeDescription
unixSecondsnumberunix seconds timestamp

Icon LinkReturns

DateTime

a new DateTime instance

Icon LinkDefined in

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


Icon Linknow

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.2.2/node_modules/typescript/lib/lib.es5.d.ts:949


Icon Linkparse

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

NameTypeDescription
sstringA date string

Icon LinkReturns

number

Icon LinkInherited from

Date.parse

Icon LinkDefined in

node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es5.d.ts:936