asp比较时间顺序

我要实现一个表单输入像"1963-7-13 17:00:00"怎么判断,最重要的问题是
我要怎么才能验证表单里面的时间不能小于现在的时间。也就是不能小于now(),谢谢大家了。解决以后你可以向我提追加分的要求。

字符串转化为时间类型,在ASP里用强制类型转换cdate

请看例子:

aaa="2963-7-13 17:00:00"

bbb=now()

if cdate(aaa)>bbb then
response.Write("表单的时间大")
else
Response.write("表单的时间小")
end if
温馨提示:答案为网友推荐,仅供参考
第1个回答  2007-01-29
if datediff('s',trim(request('dates')),now())<=0 then
repsonse.write "错误!"
end if

request('dates')
中dates为表单名
第2个回答  2007-01-30
先用cstr()把now()转换成字符,在逐个比较.
相似回答
大家正在搜