php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #66510 Important information missing in docs of DateTimeZone::listAbbreviations
Submitted: 2014-01-18 00:11 UTC Modified: 2017-01-28 16:55 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jonathan at hogervorst dot info Assigned:
Status: Open Package: Date/time related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jonathan at hogervorst dot info
New email:
PHP Version: OS:

 

 [2014-01-18 00:11 UTC] jonathan at hogervorst dot info
Description:
------------
---
From manual page: http://www.php.net/datetimezone.listabbreviations
---

Important information about the return value of this function is missing in the documentation. For example, the fact that historical timezones are included is very relevant.

The lack of this information results in actually wrong scripts. See for example this (kind of popular) code (and my comment): http://stackoverflow.com/a/2839396/251760

I have added a comment to the documentation, trying to explain the return value of this function and informing people of the 'risks' of using this function when not considering this: http://www.php.net/manual/en/datetimezone.listabbreviations.php#114161

Hopefully the documentation can be enhanced :-)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-19 17:30 UTC] kulakov74 at yandex dot ru
They should add a description for all the timezone abbreviations, cause names like 'yst' and 'yert' don't make much sense and, more important, they should add the periods of time when the zones were effective. 

At the same time, provided the periods are added to the info, I can hardly imagine a php developer who will want to find the right abbreviation for a date (the one that was effective for the date) by scannning the list, because the internal PHP functions like date(), strtotime() and the DateTime class already do it automatically for you whenever they perform date manipulations. 

So I doubt DateTimeZone::listAbbreviations() is needed at all.
 [2017-01-28 16:55 UTC] cmb@php.net
-Package: Documentation problem +Package: Date/time related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jun 25 10:01:26 2019 UTC