Skip to content

isSafeTimestamp

The isSafeTimestamp() function checks that a timestamp is between minTimestamp and maxTimestamp, the limits imposed by the JavaScript engine.

Interactive example

Syntax

typescript
function isSafeTimestamp(
	input: number
): boolean

Parameters

  • input: Timestamp in milliseconds.

Return value

true if the value can be used by Date, otherwise false.

See also

Sources

Released under the MIT license.