★★★简单的问题,高高的分!在每天早上8:30至下午5:30开放系统★★★
要求在:在每天早上8:30至下午5:30开放系统,其余时间关闭系统!
请各位帮忙写一下,要求语句精简、经过测试!
感谢!
------解决方案--------------------If datediff( "s ",date& " 08:30:00 ",now())> =0 Then
If datediff( "s ",date& " 17:30:00 ",now()) <=0 Then
response.write "ok "
Else
response.write "no "
End If
Else
response.write "no "
End If
------解决方案-------------------- <%
datBegin = Date & " 8:30 "
datEnd = Date & " 17:30 "
if Now > datEnd or Now < datBegin then
Response.Write "Closed "
Response.End
end if
%>
------解决方案--------------------晕,跟SQL语句搞混了,一楼正解:
<%
datBegin = Date & " 8:30:00 "
datEnd = Date & " 17:30:00 "
if DateDiff( "s ",Now, datBegin) <0 and DateDiff( "s ", Now, datEnd)> 0 then
Response.Write "OK "
Else
Response.Write "Closed "
Response.End
end if
%>