xxxxxxxxxx
function getUnixTime() {
return (Date.now() / 1000) | 0;
}
xxxxxxxxxx
const date = new Date();
const unixTimestamp = Math.floor(date.getTime() / 1000);
console.log(unixTimestamp);
xxxxxxxxxx
let exp = (Math.floor(Date.now() / 1000) + 60 * 60)
console.log(exp)
const expirationDate = new Date(exp * 1000);
const formattedDate = expirationDate.toISOString();
console.log(formattedDate);