Change page view depending on date?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Milkstr
    New Member
    • Sep 2006
    • 49

    Change page view depending on date?

    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???
  • dswethar
    New Member
    • Nov 2006
    • 65

    #2
    Hi,

    Are you doing this in asp or javascript?

    Comment

    • Milkstr
      New Member
      • Sep 2006
      • 49

      #3
      am working with ASP

      Comment

      • dswethar
        New Member
        • Nov 2006
        • 65

        #4
        <%

        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

        • Milkstr
          New Member
          • Sep 2006
          • 49

          #5
          thanks a lot, i'll give that a try!!!! Cheers

          Comment

          • dswethar
            New Member
            • Nov 2006
            • 65

            #6
            No Problem.

            Tell me if it works. Or give me the errors. I'll try and figure it out.

            Comment

            • Milkstr
              New Member
              • Sep 2006
              • 49

              #7
              Thanks, works perfectly!

              Comment

              Working...