var month = 0; // January var d = new Date(2008, month + 1, 0); console.log(d.toString()); // last day in January