VB/Classic ASP Timed Event

freezilla
freezilla used Ask the Experts™
on
I'm at my last day of my job but yet I still care about it!  I need to have a chunk of code that "removes" line of code at a certain time and date.  I have this (below) but I need to incorporate the hours into it.

Ideas?

<% if Date() < "05/25/2012" then %>
Display this before May 25 @ 5:00 PM
<% else %>
Display this after May 25 @ 5:00 PM
<% end if %>
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Scott FellDeveloper & EE Moderator
Fellow 2018
Most Valuable Expert 2013

Commented:
<% if date() < "05/25/2012"  and  hour(now()) < 17 then %>
Display this before May 25 @ 5:00 PM
<% else %>
Display this after May 25 @ 5:00 PM
<% end if %>
Scott FellDeveloper & EE Moderator
Fellow 2018
Most Valuable Expert 2013

Commented:
Actually, you need hashtags in your date

<% if date() < #05/25/2012#  and  hour(now()) < 17 then %>
Display this before May 25 @ 5:00 PM
<% else %>
Display this after May 25 @ 5:00 PM
<% end if %>
Expert of the Year 2008
Top Expert 2008
Commented:
Try:
<% if Now() < CDate("05/25/2012 17:00")  then %>
Display this before May 25 @ 5:00 PM
<% else %>
Display this after May 25 @ 5:00 PM
<% end if %>

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial