Skip to content

Instantly share code, notes, and snippets.

@dunklesToast
Last active September 9, 2017 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dunklesToast/7af44caad3d40500dccabe4345cbbd6a to your computer and use it in GitHub Desktop.
Save dunklesToast/7af44caad3d40500dccabe4345cbbd6a to your computer and use it in GitHub Desktop.
Simple function which returns time in a nice formatted way
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