Web Analytics Made Easy -
StatCounter show image between 9AM to 9PM - CodingForum

Announcement

Collapse
No announcement yet.

show image between 9AM to 9PM

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • show image between 9AM to 9PM

    I want to make an image appear on an asp page only between 9AM to 9PM
    Pls help

  • #2
    Code:
    <% If #9:00:00 AM# <= Time() AND Time() <= #9:00:00 PM# Then %>
        <img src="xyz.jpg">
    <% End If %>
    *or*
    Code:
    <% 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)
    Code:
    <% 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.
    Be yourself. No one else is as qualified.

    Comment


    • #3
      thanks

      Comment

      Working...
      X