求当前时间涵数==送分 应先把document.update.day_f.value转换为时间格式 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.update.day_f.value本来就是时间格式啊 <script>function check(){var today=new Date();var userday = new Date(document.update.day_f.value);return userday.getTime()<today.getTime()}</script><form name="update"><input type=text name="day_f" value="5-10-2004"><input type=button onclick="alert(check())" value="Check"></form> <SCRIPT LANGUAGE=javascript>alert(addDay(-30,1));alert(addDay(-30,2));alert(addDay(-30,3));alert(addDay(-30,0));function addDay(days,n){ //函数说明:days日期差,n代表如下含义。 var my_date_ago=new Date(new Date() - days * 24 * 60 * 60 * 1000 * -1);//days天的日期 switch (n) { case 1: //返回年 return(my_date_ago.getFullYear()); break; case 2: //返回月 return(my_date_ago.getMonth()+1); break; case 3: //返回日 return(my_date_ago.getDate()); break; default : //返回全部 return(my_date_ago.getFullYear() + "-" + (my_date_ago.getMonth()+1) + "-" + my_date_ago.getDate()); break; } } </SCRIPT> jQuery.getJSON(),二级域名取不到数据 ExtJs htmleditor 【囧】=====图片预览 发不到iis就不行了,直接双击打开可以===== 求教关于多个文本框验证的一个问题 在指定的范围内实现鼠标跟随并显示鼠标坐标 (有代码) js事件的冒泡和捕获在编程中有什么用? form的提交问题,超难? 问javascript一个很菜的问题 请问如何将jsp中的变量值传递给javacript 急,关于display的问题 js中时间的计算? 怎么计算两个时间的试检查,并且按某个格式显示
function check()
{
var today=new Date();
var userday = new Date(document.update.day_f.value);
return userday.getTime()<today.getTime()
}
</script>
<form name="update">
<input type=text name="day_f" value="5-10-2004">
<input type=button onclick="alert(check())" value="Check">
</form>
alert(addDay(-30,1));
alert(addDay(-30,2));
alert(addDay(-30,3));
alert(addDay(-30,0));function addDay(days,n)
{
//函数说明:days日期差,n代表如下含义。
var my_date_ago=new Date(new Date() - days * 24 * 60 * 60 * 1000 * -1);//days天的日期
switch (n)
{
case 1:
//返回年
return(my_date_ago.getFullYear());
break;
case 2:
//返回月
return(my_date_ago.getMonth()+1);
break;
case 3:
//返回日
return(my_date_ago.getDate());
break;
default :
//返回全部
return(my_date_ago.getFullYear() + "-" + (my_date_ago.getMonth()+1) + "-" + my_date_ago.getDate());
break;
}
}
</SCRIPT>