Date and Time question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
smoky989
Forum Commoner
Posts: 41
Joined: Mon Sep 02, 2002 1:14 pm

Date and Time question

Post by smoky989 »

ok this seems common enough but my head hurts so I'll ask you guys since you haven't failed me yet.

I want to have a PHP page only display during a certain time frame. I have four pages I want to do this for.

Page 1 - I want viewable from 11PM Friday until 1159 PM on Tuesday
Page 2 - I want viewable from 11PM Saturday until 1159 PM on Wednesday
Page 3 - I want viewable from 11PM Monday until 1159 PM on Friday
Page 4 - I want viewable from 11PM Tuesday until 1159 PM on Saturday

Any ideas for code? could I use something as simple as

Code: Select all

if(var for current date > var for beginning date && var for current date < var for end date)
&#123;
    Content of the page
&#125;
Thanks in advance for anyone who looks at this.
Last edited by smoky989 on Mon Mar 10, 2003 2:25 pm, edited 1 time in total.
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

Post Reply