#22135 [Fbk->Csd]: PHP confused by America/Los Angeles timezone
| From: | vaughan at ucla dot edu | Date: | Fri, 02 May 2003 18:48:41 +0000 |
| Subject: | #22135 [Fbk->Csd]: PHP confused by America/Los Angeles timezone | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-38951@lists.php.net to get a copy of this message | ||
ID: 22135
User updated by: vaughan at ucla dot edu
Reported By: vaughan at ucla dot edu
-Status: Feedback
+Status: Closed
Bug Type: Date/time related
Operating System: Linux (debian)
PHP Version: 4.2.3
New Comment:
I rebuilt php a while after my Feb 25th posting, and the problem
mysteriously went away. Since I run the testing dist of Debian and
update with apt regularly (almost daily), there's a good chance that
some other package got changed and that's what fixed the problem.
Previous Comments:
------------------------------------------------------------------------
[2003-05-01 20:25:49] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-02-25 13:25:51] vaughan at ucla dot edu
sniper@php.net wrote:
<snip>
You should set the timezone correctly before you _start_
apache, in the shell..</snip>
I tried that..see my posting below from 9 Feb 1:54pm. Even when TZ is
set correctly in the shell to 'America/Los_Angeles' before starting
apache, php's getenv('TZ') reports "America/Los Angeles" as the
timezone. If I set TZ to 'US/Pacific' in the shell, stop and start
apache, php still reports the timezone incorrectly as "America/Los
Angeles". So, if PHP does not seem to be picking up the timezone from
the environment. Again, the only way I can affect the timezone is
using putenv().
Not sure where to go from here. Perhaps pull from CVS and recompile?
------------------------------------------------------------------------
[2003-02-25 02:27:31] sniper@php.net
As your first script mentioned, the output for
getenv('TZ') was "America/Los Angeles" which is wrong..
------------------------------------------------------------------------
[2003-02-25 02:26:31] sniper@php.net
SetEnv in httpd.conf has no effect on PHP.
You should set the timezone correctly before you _start_
apache, in the shell..
------------------------------------------------------------------------
[2003-02-24 10:38:00] vaughan at ucla dot edu
You're right. I should have used "America/Los_Angeles".
results: experiment #1, using
putenv("TZ=America/Los_Angeles");
php produces the correct time after this, but not before (that is,
doesn't pick up TZ from the system).
experiment # 3, SetEnv TZ=America/Los_Angeles in httpd.conf
has no effect -- the time is still wrong until I use putenv with either
"US/Pacific" or "America/Los_Angeles".
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/22135
--
Edit this bug report at http://bugs.php.net/?id=22135&edit=1