At 04:57 19/03/2009, you wrote:
Date: Thu, 19 Mar 2009 12:57:44 +0800
From: Ron <r...@silverbackasp.com>
Subject: php date/time zone
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 :
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
http://www.webmasterworld.com/forum13/3922.htm then either use that
to select the selected option of a <select /> dropdown menu, or put
it directly into a hidden field and trust that it's probably as right
as you can get it.
The browser may also send header fields which could be used for this
(in POST or PUT requests only) but it's not guaranteed or reliable either.
So the best approach would probably be to automatically set the
before posting the form
Cheers - Neil
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php