Created
September 7, 2017 00:54
-
-
Save wnghdcjfe/3bf8b9e6c97a1537736203a9bcaed4cd to your computer and use it in GitHub Desktop.
set new Date beautiful
This file contains hidden or 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
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