Y星人の工作語錄

別理我, 我只是一個愛發勞騷的Y星人

10月
02

How to compare date and time (datetime) deadline ?

Posted by YuanYuan

I’m never coding ASP progarm before. some reason I need to modify the code.
I think the ASP not to hard for me.

request: compare date time expire or deadline ?
I google it, no good way to do or code to complicated. last I find easy function. CDate to do this.

  1. expire = "2009/10/02 3:08:20 PM"
  2.  
  3. if (Now() > CDate(expire)) then
  4. response.write("3over time, thanks.")
  5. else
  6. response.write("3still continued...")
  7. end if

yes, just CDate to solve this request.

Add A Comment