From: [EMAIL PROTECTED]
Operating system: Linux (debian)
PHP version: 4.2.3
PHP Bug Type: Date/time related
Bug description: PHP confused by America/Los Angeles timezone
<?
print("server timezone is: " . getenv('TZ') . "<br>\n");
print("server time is: " . date("F j, Y, g:i a") . "<br>\n");
print("changing server time zone to US/Pacific....<br>\n");
putenv("TZ=US/Pacific");
print("new server time is: " . date("F j, Y, g:i a") . "<br>\n");
print("new server timezone for this script is: " . getenv('TZ'));
?>
The above script gives the following output:
server timezone is: America/Los Angeles
server time is: February 9, 2003, 6:45 am
changing server time zone to US/Pacific....
new server time is: February 8, 2003, 10:45 pm
new server timezone for this script is: US/Pacific
the correct date and time in Los Angeles at the time of running the script
is: February 8, 2003, 10:45 pm
The date command on the system gives the correct time and date.
/etc/timezone contains US/Pacific
setting environment variable TZ=US/Pacific before restarting apache has no
effect on the above script.
PHP configure line:
'./configure' '--with-mysql' '--with-apxs'
'--with-config-file-path=/etc/php4/apache' '--enable-track-vars'
'--enable-trans-sid' '--with-sybase=/usr/local/freetds' '--with-ldap'
'--with-imap' '--with-curl=/usr' '--with-pgsql=/usr/include/postgresql'
'--with-gd' '--with-xml' '--enable-cli'
Apache/1.3.26
Apache modules are: mod_php4, mod_ssl, mod_perl, mod_dav, mod_setenvif,
mod_unique_id, mod_expires, mod_auth, mod_access, mod_rewrite, mod_alias,
mod_userdir, mod_cgi, mod_dir, mod_autoindex, mod_status, mod_negotiation,
mod_mime, mod_log_config, mod_macro, mod_so, http_core
This could be a problem with the underlying debian (2.2.19 kernel) system,
but I thought I should report it.
Thank you.
--
Edit bug report at http://bugs.php.net/?id=22135&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22135&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22135&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22135&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22135&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22135&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22135&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22135&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22135&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22135&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22135&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22135&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22135&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22135&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22135&r=gnused