- Time Management -

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 3
Joined: Thu Sep 04, 2003 7:48 am

- Time Management -

Postby Curiousguy » Thu Sep 04, 2003 7:53 am

How to create a time verification script that .?

For Example: If There is three Classes, and "Class A" is only available between 10am - 1030am, and "Class B is only available between 1200pm - 1300pm... How do i using the Pull down menu to list out only the available class for the certain time, let say "Class A" is only available in the Pull down menu when the time is between 10am - 1030am?

PLs help .... thanks

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

Postby 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.

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

Postby 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
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby 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)

Return to “PHP coding => General”

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests