php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3977 date() function no more sensitive to TZ environment variable
Submitted: 2000-03-30 04:38 UTC Modified: 2001-01-09 04:06 UTC
From: peter dot kuppelwieser at limu dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0 Release Candidate 1 OS: suse linux 6.3
Private report: No CVE-ID: None
 [2000-03-30 04:38 UTC] peter dot kuppelwieser at limu dot com
following script switches Timezones in PHP3
it does not work in PHP4

Is  there is an alternative not documented mechanism?

#--------------------
putenv("TZ=Europe/Rome");
echo date("Y/m/d H:i:s")." ".getenv("TZ")."<br>";

putenv("TZ=Asia/Seoul");
echo date("Y/m/d H:i:s")." ".getenv("TZ")."<br>";
#--------------------

#PHP CONFIG

System: Linux pjotr 2.2.13 #2 Wed Mar 15 10:13:54 CET 2000 i686 unknown
Build Date: Mar 29 2000 
Configure command: './configure' '--disable-debug' '--enable-track-vars' '--enable-trans-sid' '--with-apache=../apache_1.3.12' '--with-gd=/usr' '--with-mysql'
php.ini path: /usr/local/lib
ZEND_DEBUG=0
SAPI=Apache
ZTS is undefined

#/PHP CONFIG

Bye peter.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-02 05:08 UTC] sterling at cvs dot php dot net
This is fixed in PHP4.0.1
 [2000-07-11 11:29 UTC] peter dot kuppelwieser at limu dot com
I have now tesded tried the test script and it still does not behave correctely

The output is now unpredictable.
sometimes the timezone settings of Rome is used
and sometimes the timezone of Seoul is used 
both echo statements

(one run of test produces Seoul time)
2000/07/11 00:22:22 Europe/Rome
2000/07/11 00:22:22 Asia/Seoul

(another run of test producec Rome time)
2000/07/10 17:29:11 Europe/Rome
2000/07/10 17:29:11 Asia/Seoul

 [2001-01-09 04:06 UTC] sniper@php.net
Fixed in CVS. 

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 02:01:28 2024 UTC