View Full Version : show image between 9AM to 9PM
dips255
04-11-2009, 12:42 PM
I want to make an image appear on an asp page only between 9AM to 9PM
Pls help
Old Pedant
04-11-2009, 06:45 PM
<% If #9:00:00 AM# <= Time() AND Time() <= #9:00:00 PM# Then %>
<img src="xyz.jpg">
<% End If %>
*or*
<% If Hour(Time()) >= 9 AND Hour(Time()) <= 21 Then %>
<img src="xyz.jpg">
<% End If %>
*or* (okay, this one is silly, but just to show the weird things you *CAN* do)
<% If ( ( Hour(Time())+15 ) MOD 24 ) <= 12 Then %>
<img src="xyz.jpg">
<% End If %>
Personally, I would keep it simple and go with the first one.
dips255
04-12-2009, 08:48 AM
thanks
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.