Code to go logo
Created using Figma
Use Cases
Contribute
How to get current timestamp in seconds in JavaScript
Datetime
By Jad Joubran ·
Last updated Dec 26, 2017
const timestamp = Math.floor(Date.now() / 1000); console.log(timestamp); //in seconds
1514300500
Dec 26, 2017
1
Jad Joubran
See answer
1
Jad Joubran
Date.now
on MDN
Learn JavaScript step by step
Related use cases
How to get current timestamp in JavaScript