This helper combines asserting that a bigint represents a Unix timestamp with coercing it to the UnixTimestamp type. It's best used with untrusted input.
bigint
import { unixTimestamp } from '@solana/rpc-types';const timestamp = unixTimestamp(-42n); // Wednesday, December 31, 1969 3:59:18 PM GMT-08:00 Copy
import { unixTimestamp } from '@solana/rpc-types';const timestamp = unixTimestamp(-42n); // Wednesday, December 31, 1969 3:59:18 PM GMT-08:00
This helper combines asserting that a
bigintrepresents a Unix timestamp with coercing it to the UnixTimestamp type. It's best used with untrusted input.