Edit report at https://bugs.php.net/bug.php?id=60453&edit=1
ID: 60453 Updated by: der...@php.net Reported by: ale at alejandrolapeyre dot com dot ar Summary: ISO Format sets invalid timezone: Z -Status: Open +Status: Assigned Type: Bug Package: Date/time related PHP Version: 5.3.8 -Assigned To: +Assigned To: derick Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2011-12-06 23:03:46] ale at alejandrolapeyre dot com dot ar Description: ------------ --- >From manual page: >http://www.php.net/datetime.construct#refsect1-datetime.construct-description --- Creating a DateTime from a string in the ISO8601 format "2011-12-06T19:55:34Z" will succeed, but with a DateTimeZone with name "Z". That is incorrect, since "Z" is the way to specify UTC in that ISO format. Furthermore, if you want to create a DateTimeZone("Z") it will throw. Best regards, hope this helps to make php better :) Test script: --------------- $dt = new DateTime("2011-12-06T19:55:34Z"); $tz = $dt->getTimeZone(); echo $tz->getName(); Expected result: ---------------- "UTC" Actual result: -------------- "Z" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60453&edit=1