var date =new Date() var year=date.getFullYear(); var month=date.getMonth()+1; var lastDay=new Date(year,month,0).getDate()//获得是标准时间,需要getDate()获得天数