Skip to content

toTimestamp ​

The toTimestamp() function returns the millisecond timestamp of a TheDate.

Interactive example ​

Syntax ​

typescript
function toTimestamp<
	GenericInput extends TheDate | SerializedTheDate
>(
	input: GenericInput
): number

Parameters ​

  • input: The TheDate to convert.

Return value ​

The timestamp in milliseconds since January 1, 1970 UTC.

See also ​

Sources ​

Released under the MIT license.