var d = new Date(); var d1 = new Date(d.getYear(), d.getMonth() + 1, 0); alert(d1.getDate());
var t = new Date(); alert( t.setDate(32) && t.setDate(0) && t.getDate() )