I have a page on my site that i only want people to be able to view upto a certain time in the week, for example aftere 12 noon on Saturday i want the page to change its view, is there a simple "if statment" i can use or it there another way???
Change page view depending on date?
Collapse
X
-
<%
Dim intDay, intTime
intDay = DatePart("w",Da te)
'By default, the start day is 1 and is allocated to sunday.
intTime = Hour(Now)
'Returns in 24 hour format.
IF intDay = 7 AND intTime>12 THEN
RESPONSE.WRITE( "Its after 12 noon on saturday")
ELSE
RESPONSE.WRITE( "You can visit the website")
END IF
%>
Instead of RESPONSE.WRITE, add your codes.
You can go through more VBScript Functions at http://www.w3schools.com/vbscript/vb..._functions.asp
Hope this works for you....Comment
Comment