<script language="JavaScript" type="text/JavaScript">
var myDate = new Date();
var year = myDate.getFullYear();
var month = myDate.getMonth()+1;
if (month<10){
month = "0"+month;
}
var firstDay = month+"/"+"01/"+year;
alert(firstDay);
myDate = new Date(year,month,0);
var lastDay = month+"/"+myDate.getDate()+"/"+year;
// var firstTime = "00:00:00";
//var lastTime = "23:59:59";
alert(lastDay);
</script>
原文:http://www.cnblogs.com/lihuali/p/5606030.html