Created
August 28, 2013 08:54
-
-
Save DevelopKim/6363766 to your computer and use it in GitHub Desktop.
javascript date formatting
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 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