var checkdate_rtn=false;//全局变量,日期检查不合法则不允许保存
function checkdate()
{
var datetime=document.all["signaltime"].value;
var date=datetime.substring(0,8);
var time=datetime.substring(8,14);
var year=parseInt(datetime.substring(0,4));
var month=(datetime.substring(4,6));
var day=(datetime.substring(6,8));
var hour=(datetime.substring(8,10));
var min=(datetime.substring(10,12));
var sec=(datetime.substring(12,14));
if(datetime.length==14)//表示输入的日期长度要为14
{
if(year>1900&&year<2099)
{
if(month<13)
{
if(hour<24 && min<60 && sec<60)
{
if(month==01||month==03||month==05||month==07||month==08||month==10||month==12)
{
if(day<32)
{
checkdate_rtn=true;
}
}
if(month==02&&(day<30&&year%4==0)||(day<29&&year%4!=0))
{
checkdate_rtn=true;
}
if(month==04||month==06||month==09||month==11)
{
checkdate_rtn=true;
}
}
}
}
}
}