kaffa / textpattern

Automatically exported from code.google.com/p/textpattern
0 stars 0 forks source link

Fixing timezones part 1: timezone::details() giving historic information, modernize #400

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
timezone::details() gives few peaces of information that are random/historic. 
DateTimeZone::listAbbreviations() gives all and every abbreviations, both 
historic and current. The given data is based on timezone transitions.

What timezone::details() does is that it extracts the first instance of the 
identifier from this data set. This leads to few information that are 
potentially from the past:

* dst: Its random peace of information from some point of time. This could be 
changed to the current DST status.
* abbr: Is alphabetically first abbr in the dataset. By change this might be 
correct.
* offset used for reversing: should be the calculated offset. Currently uses 
historic value.

Neither DateTimeZone::listAbbreviations() or DateTimeZone::listIdentifiers() 
can give:

* Up to date timezone abbr(s)
* DST, or whether the timezone uses DST.

These must be extracted from the zone files. In PHP this is possible with 
DateTimeZone::getTransitions(), but this is way too slow on PHP 5.2.0 to be 
used for generating actual lists of consisting all timezones. Prior 5.3.0 it 
extracts the whole database with all transitions.

Todo:

* Modernize, PSR-0.
* New timezone listing based on listIdentifiers, DateTime and DateTimeZone.
* Drop extra information we can not give from the dataset and provide 
additional methods for extracting them.

Original issue reported on code.google.com by jukka.m.svahn on 30 Nov 2013 at 10:12

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r5659.

Original comment by jukka.m.svahn on 1 Dec 2013 at 11:03