Answers for "current time in seconds javascript"

4

current time in javascript

new Date().toLocaleString();

>> "09/08/2014, 2:35:56 AM"
Posted by: Guest on December-30-2020
0

js get current seconds

// Rounds the value
const timestamp = Math.round(new Date() / 1000); // 1405792937

// - OR -

// Floors the value
const timestamp = new Date() / 1000 | 0; // 1405792936
Posted by: Guest on June-17-2020

Code answers related to "current time in seconds javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language