|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-07-13 10:48 UTC] derick@php.net
[2008-07-13 11:00 UTC] pager at marck dot us
[2008-07-13 11:03 UTC] derick@php.net
[2008-07-13 11:18 UTC] pager at marck dot us
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 06:00:01 2025 UTC |
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