ID: 45498 Updated by: [EMAIL PROTECTED] Reported By: pager at marck dot us -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Windows XP Home PHP Version: 5.2.6 New Comment:
This is not a bug - strftime() uses the Operating System timezone information which applications can not override. You want the date() function to handle this correctly. The date() function does not rely on the Operating System for any formatting. Previous Comments: ------------------------------------------------------------------------ [2008-07-13 10:24:08] pager at marck dot us 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 this bug report at http://bugs.php.net/?id=45498&edit=1