- Time Management -

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
tryton
New php-forum User
New php-forum User
Posts: 49
Joined: Wed Jul 09, 2003 8:25 am
Location: Joze
Contact:

Post by tryton » Thu Sep 04, 2003 3:38 pm

Your best bet is to grab the system timestamp and then compare for each value. Try hotscripts.com to find a script that has already been written.

Joel
New php-forum User
New php-forum User
Posts: 193
Joined: Sat Mar 29, 2003 11:57 pm
Location: Auckland, New Zealand
Contact:

Post by Joel » Thu Sep 04, 2003 11:35 pm

To get the current hour do this.

Code: Select all

$currhour = date("H", time());


Then with your pull down menu have a switch statement deciding which choice to use. Remember, the hour will be the servers hour rather than the users timezones hour.

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Post by Redcircle » Fri Sep 05, 2003 3:40 pm

if you are unsure what timezone your server is in you can use gmdate('H', time()) which always outputs GMT

you will then need to calculate your time offset

EST this is (60*60)*(-5)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests