Functions
assertIsUnixTimestamp
assertIsUnixTimestamp(
putativeTimestamp
):asserts putativeTimestamp is UnixTimestamp
Timestamp values returned from the RPC API conform to the type UnixTimestamp. You can use a value of that type wherever a timestamp is expected.
Parameters
Parameter | Type |
---|---|
putativeTimestamp | bigint |
Returns
asserts putativeTimestamp is UnixTimestamp
Example
From time to time you might acquire a number that you expect to be a timestamp, from an untrusted network API or user input. To assert that such an arbitrary number is usable as a Unix timestamp, use this function.