@metamask/keyring-snap-sdk
Version:
MetaMask Keyring Snap SDK
18 lines • 431 B
JavaScript
/**
* Convert a date to its UNIX timestamp equivalent.
*
* @param date - The date object to convert.
* @returns A UNIX timestamp.
*/
export function toUnixTimestamp(date) {
return Math.floor(date.getTime() / 1000);
}
/**
* Get the current UNIX timestamp.
*
* @returns The current UNIX timestamp.
*/
export function getCurrentUnixTimestamp() {
return toUnixTimestamp(new Date());
}
//# sourceMappingURL=time.mjs.map