我如何比较在VBScript / ASP两个日期? [英] How can I compare two dates in vbscript/ASP?
本文介绍了我如何比较在VBScript / ASP两个日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用ASP经典,我需要以某种方式相互比较两个日期。我怎样才能做到这一点?
解决方案
=日期1 #rs [日]#
DATE2 =#11/1/2009年#
如果则DateDiff(D,日期1,日期2)GT; 1然后
RESPONSE.WRITE此日期前12/1/2009
其他
RESPONSE.WRITE此日期后12/1/2009
万一
心连心
Using ASP classic, I need to somehow compare two dates with each other. How can I do this?
解决方案
Date1 = #rs["date"]#
Date2 = #12/1/2009#
If DateDiff("d", Date1, Date2) > 1 Then
response.write "This date is before 12/1/2009"
Else
response.write "This date is after 12/1/2009"
End If
HTH
这篇关于我如何比较在VBScript / ASP两个日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文