取得当前月的天数
<script language="Javascript">
Date.prototype.getDays=function(){
var _newDate=new Date();
_newDate.setMonth(_newDate.getMonth()+1);
_newDate.setDate(0);
$_days=_newDate.getDate();
delete _newDate;
return $_days;
}
var newDate=new Date();
alert("本月有"+newDate.getDays()+"天");
alert(newDate.getFullYear()+"-"+(newDate.getMonth()+1));
</script>
Date.prototype.getDays=function(){
var _newDate=new Date();
_newDate.setMonth(_newDate.getMonth()+1);
_newDate.setDate(0);
$_days=_newDate.getDate();
delete _newDate;
return $_days;
}
var newDate=new Date();
alert("本月有"+newDate.getDays()+"天");
alert(newDate.getFullYear()+"-"+(newDate.getMonth()+1));
</script>