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

Get the current timestamp in seconds

JavaScript

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

TypeScript

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