开发者

ASP Date Comparison

Here is the code.

<%

expire_date = Session("expiration_date")
current_date = date()

If current_date >= expire_date Then
response.Redirect("../login_expiration.asp")
Else
' do n开发者_运维问答othing
End If

%>

Assuming the expiration date is 7/10/2011, what should happen? I expect the redirect to happen, but the opposite does. If I change the operator to "<=", the redirect happens.

What am I missing?

Thanks

Brett


You may need to cast Session("expiration_date") from a string to a date:

expire_date = CDate(Session("expiration_date"))

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜