[Home] >  Date Time >  Get the current timestamp in seconds

Get the current timestamp in seconds

JavaScript version

const ts = () => Math.floor(new Date().getTime() / 1000);

TypeScript version

const ts = (): number => Math.floor(new Date().getTime() / 1000);