Timezones NOT taken into Consideration...

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
rklockner
Forum Newbie
Posts: 22
Joined: Tue Feb 09, 2010 9:56 am

Timezones NOT taken into Consideration...

Post by rklockner »

I am working with an enormous existing code base that was never developed to include alternate timezones.

The software is currently in use nationwide (and some users out of the country), and we are currently stating "All Times are EST" everywhere in the software. The more people that are signing up, the bigger the problem is getting.

I know I can go everywhere in the software that lists a time and adjust the time before it is output, but is there a way that will automatically adjust based on the users current timezone?

I tried to do some searches on this, but I couldn't word it in a way that returned valuable results.

Any help will be appreciated (even if the advice is "Suck it up and alter each occurence manually").

Thanks,

Ryan
MichaelR
Forum Contributor
Posts: 148
Joined: Sat Jan 03, 2009 3:27 pm

Re: Timezones NOT taken into Consideration...

Post by MichaelR »

Only if you switch the time/date to be output through JavaScript.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Timezones NOT taken into Consideration...

Post by AbraCadaver »

I would have to see full examples of how you are retrieving times and displaying them, but you need to get the user's timezone either by them selecting it or by using javascript. Then just use date_default_timezone_set() in a global header or config file.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply