Timezones

From: Date: Fri, 19 Nov 2004 11:56:55 +0000
Subject: Timezones
Groups: php.general 
Request: Send a blank email to php-general+get-202505@lists.php.net to get a copy of this message
Hi, I have a legacy PHP3 system and a MySQL DB with two tables: user { user_id int, timezone varchar (like "Europe/Brussels", "US/Eastern", "America/New_York", etc.) } and messages { msg_id int, user_id int, date int } When a user submits a message, my PHP script (using time() function) stores the submission time in messages.date field. However this value is not the server's system time but shifted according the users timezone. 1. How can I convert it to reflect my timezone (ex. GMT)? Is there a way to find the offset between two timezones given in long format as in my table? 2. I would appreciate any information on how the PHP/Apache handles the timezone offset when calculating the time. Which of the PHP date/time functions take into consideration the environment variable TZ (upon user login there is putenv('TZ='.user_get_timezone()); command)? Thank you in advance, Venelin

« previous php.general (#202505) next »