Last active
September 9, 2017 12:49
-
-
Save dunklesToast/7af44caad3d40500dccabe4345cbbd6a to your computer and use it in GitHub Desktop.
Simple function which returns time in a nice formatted way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDate() { | |
const d = new Date(); | |
return `[${('0'+d.getDate()).toString().substr(-2)}.${('0'+(d.getMonth()+1)).toString().substr(-2)}.${d.getFullYear()} / ${('0'+d.getHours()).toString().substr(-2)}:${('0'+d.getMinutes()).toString().substr(-2)}:${('0'+d.getSeconds()).toString().substr(-2)}]` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment