const formatedTimestamp = ()=> {
const d = new Date()
const date = d.toISOString().split('T')[0];
const time = d.toTimeString().split(' ')[0].replace(/:/g, '-');
return `${date} ${time}`
}
Created
June 1, 2020 14:26
-
-
Save mohokh67/e0c5035816f5a88d6133b085361ad15b to your computer and use it in GitHub Desktop.
Get YYYY-MM-DD HH-MM-SS in JavaScript
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment