-
-
Save cocodrips/47c3b0f37c93efa37def to your computer and use it in GitHub Desktop.
jsで日付好きな文字でjoinするのが見つからなかった
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
var date_string = function(d, join) { | |
//Date -> 20150101 | |
var year = (d.getYear() + 1900).toString(); | |
var month = ('0' + (d.getMonth() + 1).toString()).slice(-2); | |
var day = ('0' + d.getDate().toString()).slice(-2); | |
return year + join + month + join + day; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment