#39248 [Opn->Bgs]: strftime("%z") inconsistant in non-GMT zones.

From: Date: Tue, 24 Oct 2006 19:07:38 +0000
Subject: #39248 [Opn->Bgs]: strftime("%z") inconsistant in non-GMT zones.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-103948@lists.php.net to get a copy of this message
ID: 39248 Updated by: tony2001@php.net Reported By: Lhunath at Pandora dot Be -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Gentoo Linux 2.6.18 PHP Version: 5.1.6 New Comment: We are happy to tell you that you just discovered Daylight Savings Time. For more information see: http://webexhibits.org/daylightsaving/b.html Instead of using mktime/date consider using gmmktime and gmdate which do not suffer from DST. Previous Comments: ------------------------------------------------------------------------ [2006-10-24 18:53:31] Lhunath at Pandora dot Be Description: ------------ The time zone used to generate formatted time from a timestamp changes depending on the timestamp itself, unless if the timezone is set to GMT. Reproduce code: --------------- date_default_timezone_set("Europe/Brussels"); $time=1162072800; print(strftime("%c %z", $time))."\n"; $time+=86400; print(strftime("%c %z", $time))."\n"; Expected result: ---------------- The two lines should reflect a time with 24 hours difference. Both lines should display the time as defined by the selected timezone (Which in the example code is 'Europe/Brussels', which is +0100). Actual result: -------------- The two lines reflect a time with 24 hours difference, but they are formatted in different time zones. The first is obviously not in the correct timezone ('Europe/Brussels'), even though the timezone was set correctly. Sun Oct 29 00:00:00 2006 +0200 Sun Oct 29 23:00:00 2006 +0100 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39248&edit=1

« previous php.bugs (#103948) next »