Created
November 7, 2018 22:35
-
-
Save eto4detak/8a41fac6e21ab9fd90398158dd644347 to your computer and use it in GitHub Desktop.
js date
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
Date.prototype.yyyymmdd = function() { | |
var mm = this.getMonth() + 1; // getMonth() is zero-based | |
var dd = this.getDate(); | |
return [this.getFullYear(), | |
(mm>9 ? '' : '0') + mm, | |
(dd>9 ? '' : '0') + dd | |
].join('/'); | |
}; | |
Jan02_1970.yyyymmdd() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment