Jump to content

ASP time

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
probashi

probashi

    Newbie

  • Members
  • Pip
  • 3 posts
New to ASP and need some help please
I’m using the below:
<% 
   if (hour(now) >= 18) and (hour(now) <= 23) then %>
    we are open.
<% end if 
   if (hour(now) >= 23) and (hour(now) <= 18) then %>
    we are closed.
<% end if %>
However, I need to include minutes and can’t seem to figure it out.
i.e >= 18:30 - <= 23:00

Thanks in advance

Edited by WingedPanther, 18 November 2009 - 07:06 PM.
add code tags (the # button)


#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
<%
  if (((hour(now) = 18) and (minute(now) >= 30)) or ((hour(now) > 18) and (hour(now)<=23)) then
%>
  we are open.
<% 
else
%>
  we are closed.
<%
end if
%>

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog