From: shj at xenosi dot de Operating system: Linux PHP version: 5.2.6 PHP Bug Type: Date/time related Bug description: new DateTime('with timezone') getName() problem
Description: ------------ new DateTimeZone('PST') and new DateTimeZone('America/Los_Angeles') are same. please, modify getTimezone()->getName() output. thank you. Reproduce code: --------------- <?php $datetime = new DateTime('Dec-01-08 08:17:40 PST'); echo "new PST\n"; echo $datetime->getTimezone()->getName(); echo "\n"; echo $datetime->format('Y-m-d H:i:s'); echo "\n"; $pst = new DateTimeZone('PST'); $datetime->setTimezone($pst); echo "DateTimeZone PST\n"; echo $datetime->getTimezone()->getName(); echo "\n"; echo $datetime->format('Y-m-d H:i:s'); echo "\n"; $kst = new DateTimeZone('KST'); $datetime->setTimezone($kst); echo "DateTimeZone KST\n"; echo $datetime->getTimezone()->getName(); echo "\n"; echo $datetime->format('Y-m-d H:i:s'); echo "\n"; ?> Expected result: ---------------- new PST PST 2008-12-01 08:17:40 DateTimeZone PST America/Los_Angeles 2008-12-01 08:17:40 DateTimeZone KST Asia/Seoul 2008-12-02 01:17:40 Actual result: -------------- new PST America/Los_Angeles 2008-12-01 08:17:40 DateTimeZone PST America/Los_Angeles 2008-12-01 08:17:40 DateTimeZone KST Asia/Seoul 2008-12-02 01:17:40 -- Edit bug report at http://bugs.php.net/?id=46552&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46552&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46552&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46552&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46552&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46552&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46552&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46552&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46552&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46552&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46552&r=support Expected behavior: http://bugs.php.net/fix.php?id=46552&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46552&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46552&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46552&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46552&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46552&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46552&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46552&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46552&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46552&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46552&r=mysqlcfg