ID: 22135 Comment by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Date/time related Operating System: Linux (debian) PHP Version: 4.2.3 New Comment:
"apachectl restart" does not pick up the new TZ environment variable. Did you try apachectl stop / apachectl start? I get the same results as you with TZ="America/Los Angeles", but "America/Los_Angeles" or "US/Pacific" work. As far as I know there's no php.ini setting that fiddles with timezones. Previous Comments: ------------------------------------------------------------------------ [2003-02-09 10:54:54] [EMAIL PROTECTED] Yes, tzselect suggests that TZ be set as 'America/Los_Angeles'. I did this, using export TZ='America/Los_Angeles' and restarted apache. It made no difference to the php script output. In other words, if php believes that the server timezone is 'America/Los_Angeles' it gives the incorrect time. But if it believes that timezone is 'US/Pacific' it gives the correct time. However, setting TZ to 'US/Pacific' also makes no difference to the script output. So I'm wondering where PHP is picking up the timezone information from and how I can get it to believe that the timezone is 'US/Pacific' from startup. Can I set that in php.ini? (Also, there are two timezone commands on debian, tzselect and tzconfig. tzconfig lets one choose either 'US/Pacific' or 'America/Los_Angeles' for the timezone, but neither makes a difference to this script). ------------------------------------------------------------------------ [2003-02-09 07:49:05] [EMAIL PROTECTED] Using tzselect on Debian leads to the assumption that your TZ variable should probably be "America/Los_Angeles" (with underscore). Can you test that, please? ------------------------------------------------------------------------ [2003-02-09 00:56:15] [EMAIL PROTECTED] <? 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 this bug report at http://bugs.php.net/?id=22135&edit=1