Skip to content

Instantly share code, notes, and snippets.

@houoop
Created May 10, 2013 08:30
Show Gist options
  • Save houoop/5553185 to your computer and use it in GitHub Desktop.
Save houoop/5553185 to your computer and use it in GitHub Desktop.
format js date
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