|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-15 18:48 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: derick
[2010-07-18 01:20 UTC] k.schroeder@php.net
[2011-06-05 15:30 UTC] bjori@php.net
[2011-06-05 15:30 UTC] bjori@php.net
-Status: Assigned
+Status: Closed
-Assigned To: derick
+Assigned To: bjori
[2011-06-05 15:30 UTC] bjori@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 14:00:01 2025 UTC |
Description: ------------ Hi There seem to be a discrepency for timezones names as reported by timezone_abbreviations_list() and the DateTime object parser. We have found a (small) numbre of timezones for which this happens: Been reported and reproduced with PHP 5.1.41 adn PHP 5.2.13 Test script: --------------- 1 - Get identifiers list: $all = timezone_abbreviations_list(); The resulting array contains, for instance: [54] => Array ( [dst] => [offset] => 36000 [timezone_id] => Australia/NSW ) 2 - Use this timezone_id to create a DateTimeObject $dateString = "2010-05-15 00:00:00 Australia/NSW"; $date = new DateTime( $dateString); Expected result: ---------------- A DateTime object created The above code runs without problem if timezone identifier (Australia/NSW) is replaced by Australia/Nsw. I have found the following timezones to have the same issue: Australia/ACT NZ-CHAT America/Know_IN Australia/LHI Chile/EasterIsland Europe/Isle_of_Man In others, all timezones names that do not follow camelcase strictly. There are probably others. Actual result: -------------- Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() [datetime.--construct]: Failed to parse time string (2010-05-15 00:00:00 Australia/NSW) at position 20 (A): The timezone could not be found in the database' in /XXXX/test.php on line 4