Skip to content

Instantly share code, notes, and snippets.

@masautt
Created September 3, 2019 22:07
Show Gist options
  • Save masautt/c95a8d98fadc2878a3fdcbdfb2c99e30 to your computer and use it in GitHub Desktop.
Save masautt/c95a8d98fadc2878a3fdcbdfb2c99e30 to your computer and use it in GitHub Desktop.
How do you get a timestamp in JavaScript?
//Get the EPOCH Time
console.log(Date.now()) //--> 1567548304725
//Get a string date
console.log((new Date).toLocaleString()); //--> 9/3/2019, 3:07:03 PM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment