Created
January 24, 2015 12:28
-
-
Save yuily/b2d2ed015db476f1f442 to your computer and use it in GitHub Desktop.
【JavaScript】 日付を計算するプログラム
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 dt = new Date(); | |
var month = dt.getMonth()+1; | |
var day = dt.getDate(); | |
var lastMonth = dt.setMonth(dt.getMonth() -1); | |
var lastmonth = dt.getMonth()+1;//このコードを忘れると、数字の羅列で表示される。 | |
var twoMonths = dt.setMonth(dt.getMonth() -2); | |
var twomonth = dt.getMonth()+1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
JavaScriptで今日の日付から、1ヶ月前、2ヶ月前を計算するプログラムです。