Skip to content

Instantly share code, notes, and snippets.

@DevelopKim
Created August 28, 2013 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DevelopKim/6363766 to your computer and use it in GitHub Desktop.
Save DevelopKim/6363766 to your computer and use it in GitHub Desktop.
javascript date formatting
var today = new Date();
var delimeter = '/';
var formatDate = today.getFullYear() + delimeter +
('0' + (today.getMonth() + 1)).slice(-2) + delimeter +
('0' + today.getDate()).slice(-2);
//ex . Wed Aug 28 2013 17:50:28 GMT+0900 (KST) -> "2013/08/28"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment