gmtime returns local time

From: Date: Mon, 09 Dec 2002 03:40:01 +0000
Subject: gmtime returns local time
Groups: php.install 
Request: Send a blank email to php-install+get-9331@lists.php.net to get a copy of this message
My PHP-based web mail apps are returning incorrect times. Some research shows that this might be a mod_php4 installation issue. Consider the following. <?php echo "GMT: " . gmdate( "D, j M Y H:i:s" ) . "<BR>"; echo "Local: " . date( "D, j M Y H:i:s" ) . "<BR>"; echo "Env: " . getenv("TZ"); ?> ...returns... GMT: Mon, 9 Dec 2002 03:22:47 Local: Mon, 9 Dec 2002 03:22:47 Env: US/Eastern ...on one of my servers that isn't behaving properly. The one that is behaving properly returns... GMT: Mon, 9 Dec 2002 03:22:24 Local: Sun, 8 Dec 2002 22:22:24 Env: When looking through phpinfo(), I find that the server with the GMT=Local problem have "TZ" defined under "Environment" as being the local time zone while the other server does not have any value for TZ. The problem server says... > uname -a FreeBSD zeus.cairodurham.org 4.7-STABLE FreeBSD 4.7-STABLE #7: Tue Nov 19 20:26:25 EST 2002 jkikpole@zeus.cairodurham.org:/usr/obj/usr/src/sys/ZEUS i386 [phpinfo() output] PHP Version 4.2.3 ...while the well behaved server says... > uname -a FreeBSD malkav.snowmoon.com 4.6-RC FreeBSD 4.6-RC #2: Tue Jun 4 13:32:21 EDT 2002 jaime@malkav.snowmoon.com:/usr/obj/usr/src/sys/MALKAV i386 [phpinfo() output] PHP Version 4.2.1 Any tips, advise, etc. would be greatly appreciated. I'd really like to get this bug squashed. :) Thanks in advance, Jaime -- Network Administrator Cairo-Durham Central School District

« previous php.install (#9331) next »