Is timezone correct for new DST in Apia, Samoa?

Is timezone correct for new DST in Apia, Samoa?

by Kevin Guske -
Number of replies: 3
One of our instructors is in Samoa, which recently introduced DST. Since we haven't updated the timezone table, this caused a problem with scheduling. Before updating the table, I checked http://download.moodle.org/timezone/ to see if there were any changes and found these records for Apia:

749,Pacific/Apia,1970,,-660,0,0,0,0,0,00:00,0,0,0,0,00:00 750,Pacific/Apia,2010,,-660,0,0,0,0,0,00:00,0,0,0,0,00:00

Previously, only the first record existed. Some questions:
  • If the data is the same for Apia in the second record (other than the year 2010), how is this new record useful (or is it incorrect)?
  • Is there something behind the scenes that happens that is triggered by this second record based solely on the year, or should additional information be specified in this record?
  • How are the name and tzrule attributes used? I couldn't find any evidence in the code that tzrule is used for anything. It would be helpful to see a description of how the attributes in the timezone table are used, but I couldn't find this anywhere.


Average of ratings: -
In reply to Kevin Guske

Re: Is timezone correct for new DST in Apia, Samoa?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Kevin,

if I'm not wrong the key here is that there are two ways, in the original Olson files (ftp://elsie.nci.nih.gov/pub/) to define how daylight savings are going to work:

- Rule based: The timezone makes reference to some rule where daylight savings are specified.
- Explicitly: The timezone directly specifies daylight savings.

In the case of Pacific/Apia, the 2nd way is the used one (explicitly saying that, in 2010 Sep 26 and 2011 Apr 3 there will be some changes, but not referencing any rule at all (1st way).

Unlucky those explicitly defined daylight savings aren't processed by Moodle and only the rule based ones are. Reading the code in charge of processing those Olson timezones I've seen comments directly discarding those "explicitly" DST rules. It seems that 99% of timezones are using the "rule based" approach (hence, working) but there are others, like Pacific/Apia, where, as commented the DST will fail.

That's all I can say from my quick review of the problem, hope it helps.

Ciao smile




In reply to Eloy Lafuente (stronk7)

Re: Is timezone correct for new DST in Apia, Samoa?

by Kevin Guske -
Thank you - I wasn't aware of this. Do you know if Moodle downloads or reads the Olson data? I can't find any evidence of downloading.
In reply to Kevin Guske

Re: Is timezone correct for new DST in Apia, Samoa?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Kevin,

yes, Moodle is able to read olson files directly, parsing them and building, exactly the contents available at: http://download.moodle.org/timezone/ (that is the format that internally Moodle uses for all TZ calculations).

Yo can see the complete instructions to convert the Olson files to Moodle internal format here: MDL-18576

Ciao smile