asp中时间判断处理

来源:百度知道 编辑:UC知道 时间:2024/05/21 23:48:27
我想对 时间进行处理,比如在时间08:00--18:00间可以操作某项功能.怎么把当前时间与设置时间进行比较?急需.谢谢了。代码越精越好。尽量多解释.谢谢了。

dim TimeA,TimeB,CurTime

TimeA = CDate(Date & " " & "08:00")
TimeB = CDate(Date & " " & "18:00")
CurTime = now()

if CurTime>= TimeA And CurTime <=TimeB Then

'执行操作
end if

a = newdatetime()
b = datetime()
if a = b then
............
else if a <> b then
............
end if
end if
还有就可以用JAVA写时间事件