note 51314 added to function.putenv
| From: | otie at ev1 dot net | Date: | Sun, 27 Mar 2005 04:02:12 +0000 |
| Subject: | note 51314 added to function.putenv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87040@lists.php.net to get a copy of this message | ||
trying to change timezones using putenv:
In my case (php 4.2.2) (redhat 2.4.21-1.1931.2.274) TZ does not show up in either the PHP or Linux
environment. I'm not sure what the format for TZ is. I tried TZ=EST5EDT. It seemed to work.
When I started a session with another browser, it worked there too. Even though I didn't change
the environment there.... Hmmm.
When I ran the test without the putenv... the date() function would sometimes show CST (my zone),
sometimes EST. Every time I reloaded the page, the time would change zones. All times from a
database - not time() time.
Restoring my TZ=CST didn't help. The times would still switch back and forth.
I finally restarted Apache. That worked. The times are now stable.
I think the only solution is subtracting (or adding) the appropriate time difference from the time
stamp.
I wonder what the time functions are looking at.
O.
----
Manual Page -- http://www.php.net/manual/en/function.putenv.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51314
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51314&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51314&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51314&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51314&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51314&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51314&report=yes
Search -- http://master.php.net/manage/user-notes.php