Bug #60453 [Opn->Asn]: ISO Format sets invalid timezone: Z

From: Date: Tue, 06 Dec 2011 23:58:50 +0000
Subject: Bug #60453 [Opn->Asn]: ISO Format sets invalid timezone: Z
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-165710@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60453&edit=1 ID: 60453 Updated by: derick@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

« previous php.bugs (#165710) next »