Timezones

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux