UNPKG

@metamask/keyring-snap-sdk

Version:
22 lines 596 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toUnixTimestamp = toUnixTimestamp; exports.getCurrentUnixTimestamp = getCurrentUnixTimestamp; /** * Convert a date to its UNIX timestamp equivalent. * * @param date - The date object to convert. * @returns A UNIX timestamp. */ function toUnixTimestamp(date) { return Math.floor(date.getTime() / 1000); } /** * Get the current UNIX timestamp. * * @returns The current UNIX timestamp. */ function getCurrentUnixTimestamp() { return toUnixTimestamp(new Date()); } //# sourceMappingURL=time.cjs.map