Re: Subject: php date/time zone

Re: Subject: php date/time zone

am 19.03.2009 22:47:30 von Neil Smth

At 04:57 19/03/2009, you wrote:
>Message-ID: <49C1D0C8.30109@silverbackasp.com>
>Date: Thu, 19 Mar 2009 12:57:44 +0800
>From: Ron
>Subject: php date/time zone
>
>Hi All,
>
>I have a form where in a user will enter a time and choose a timezone.
>
>based on those, i need to insert to db the time as the actual time
>on their timezone. how can i compute that on php? is it possible?


You can either do it in MySQL, by storing the UTC time of the action,
and a timezone offset :
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functio ns.html#function_convert-tz

Or you could take Keith Devens approach and handle it in PHP :
http://keithdevens.com/weblog/archive/2004/Jul/28/Times.PHP. MySQL based on
http://keithdevens.com/weblog/archive/2004/Jul/15/MySQL.time previous post

To determine the users timezone *for* them, in the web page a little
javascript would often be able to help set the timezone of a dropdown.
http://www.webmasterworld.com/forum13/3922.htm then either use that
to select the selected option of a