note 51314 rejected from function.putenv by danbrown

From: Date: Sun, 20 Jul 2008 01:02:47 +0000
Subject: note 51314 rejected from function.putenv by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-141882@lists.php.net to get a copy of this message
Note Submitter: otie at ev1 dot net ---- 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.

« previous php.notes (#141882) next »