node get unix timestamp

// Get the current Unix timestamp in seconds
const currentTimestampInSeconds = Math.floor(Date.now() / 1000);

console.log(currentTimestampInSeconds);

Explanation: 1. Date.now() returns the current timestamp in milliseconds since the Unix Epoch (January 1, 1970, 00:00:00 UTC). 2. Dividing the obtained timestamp by 1000 converts it from milliseconds to seconds. 3. Math.floor() rounds down the resulting value to get the current Unix timestamp in seconds. 4. Finally, the obtained Unix timestamp in seconds is logged to the console.