function d(strYear,strMonth,strDay)
{
var date=new Date(strYear,strMonth-1,strDay,0,0);
alert(date)
}
d(2009,3,31)
d(2009,4,1)