Skip to content

Instantly share code, notes, and snippets.

@wnghdcjfe
Created September 7, 2017 00:54
Show Gist options
  • Save wnghdcjfe/3bf8b9e6c97a1537736203a9bcaed4cd to your computer and use it in GitHub Desktop.
Save wnghdcjfe/3bf8b9e6c97a1537736203a9bcaed4cd to your computer and use it in GitHub Desktop.
set new Date beautiful
var now = new Date();
var year = now.getFullYear();
var day = ("0" + now.getDate()).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var hour = ("0" + now.getHours()).slice(-2);
var minutes = ("0" + now.getMinutes()).slice(-2);
return year + month + day;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment