#45498 [NEW]: strftime('%z') not obeying date_default_timezone_set()

From: Date: Sun, 13 Jul 2008 10:24:08 +0000
Subject: #45498 [NEW]: strftime('%z') not obeying date_default_timezone_set()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-126591@lists.php.net to get a copy of this message
From: pager at marck dot us Operating system: Windows XP Home PHP version: 5.2.6 PHP Bug Type: Date/time related Bug description: strftime('%z') not obeying date_default_timezone_set() Description: ------------ strftime is not showing the correct time zone as set by date_default_timezone_set Please note strftime reflects the correct time for the new time zone setting, but not the correct time zone. Reproduce code: --------------- <?php error_reporting(E_ALL); $before = strftime('%H:%M %z'); date_default_timezone_set('America/New_York'); $after = strftime('%H:%M %z'); echo("date('e'): ". date('e'). ", strftime('%z'): ". strftime('%z')); echo ", strftime('%H:%M %z') before: $before, strftime('%H:%M %z') after: $after"; ?> Expected result: ---------------- date('e'): America/New_York, strftime('%z'): Eastern Daylight Time, strftime('%H:%M %z') before: 05:21 Eastern Daylight Time, strftime('%H:%M %z') after: 06:21 Eastern Daylight Time Actual result: -------------- date('e'): America/New_York, strftime('%z'): Central Daylight Time, strftime('%H:%M %z') before: 05:21 Central Daylight Time, strftime('%H:%M %z') after: 06:21 Central Daylight Time // note: on my setup Central Daylight Time would be expected if date_default_timezone_set had not been used -- Edit bug report at http://bugs.php.net/?id=45498&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45498&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45498&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45498&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45498&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45498&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45498&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45498&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45498&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45498&r=support Expected behavior: http://bugs.php.net/fix.php?id=45498&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45498&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45498&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45498&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45498&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45498&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45498&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45498&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45498&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45498&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45498&r=mysqlcfg

« previous php.bugs (#126591) next »