Created
May 10, 2013 08:30
-
-
Save houoop/5553185 to your computer and use it in GitHub Desktop.
format js date
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
var formatDate = function(time) { | |
return [time.getFullYear(), '-', time.getMonth() + 1, '-', time.getDate(), | |
' ', time.getHours(), ':', time.getMinutes(), ':', | |
time.getSeconds()].join(''); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment