isValidUnixSeconds
Signature
Section titled “Signature”isValidUnixSeconds(timestamp: unknown): booleanReturn true when timestamp is a Unix seconds value every unix/ function accepts.
- A number must be a safe integer; a string must be an optionally negative run of ASCII digits (
"1700000000","-86400"), with no whitespace,+, decimal point, exponent or hex. - The instant must lie in the Temporal range: ±8.64e12 seconds (10^8 days) from the epoch.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
timestamp | unknown | candidate value of any type |
Returns
Section titled “Returns”boolean indicating whether the timestamp is a valid Unix seconds value
Examples
Section titled “Examples”import { isValidUnixSeconds } from "@northguild/gmt/unix/validate";
isValidUnixSeconds(1700000000) // true