2012-08-10 JavaScriptで月末日を取得する方法 JavaScript JavaScriptで月初日と月末日を取得する方法のメモ。 var today = new Date(); // 今月の初日を取得 new Date(today.getFullYear(), today.getMonth(), 1) // 今月の末日を取得 new Date(today.getFullYear(), today.getMonth() + 1, 0) // 先月の初日を取得 new Date(today.getFullYear(), today.getMonth() -1 , 1) // 先月の末日を取得 new Date(today.getFullYear(), today.getMonth(), 0) // 来年の今月と同じ月の末日を取得 new Date(today.getFullY