Re: Change Summertime more than one time a year (Ramadan)
Here is the official "Time Zone Database" maintained by IANA: http://www.iana.org/time-zones
The only reliable way of turning UTC into local wall clock time is to import this rules on every firmware release and apply them.
For a dozen built-in Timezones:
"Europe - Central European Time (UTC+1)",
"Europe - East European Time (UTC+2)",
"Europe - West European Time (UTC)",
...
we have built-in POSIX timezone strings:
"CET-1CEST-2,M3.5.0/2,M10.5.0/3",
"EEST-2EEDT-3,M3.5.0/3,M10.5.0/4",
"GMT0BST-1,M3.5.0/1,M10.5.0/2",
....
Even this information is more ten years old (not regularly checked if still valid).
For all other localities we leave it up to the user to select "Other" and enter a proper POSIX timezone string.
But as we learned you cannot put Morocco time into a POSIX timezone string at all.
For 2 reasons:
The only reliable way of turning UTC into local wall clock time is to import this rules on every firmware release and apply them.
For a dozen built-in Timezones:
"Europe - Central European Time (UTC+1)",
"Europe - East European Time (UTC+2)",
"Europe - West European Time (UTC)",
...
we have built-in POSIX timezone strings:
"CET-1CEST-2,M3.5.0/2,M10.5.0/3",
"EEST-2EEDT-3,M3.5.0/3,M10.5.0/4",
"GMT0BST-1,M3.5.0/1,M10.5.0/2",
....
Even this information is more ten years old (not regularly checked if still valid).
For all other localities we leave it up to the user to select "Other" and enter a proper POSIX timezone string.
But as we learned you cannot put Morocco time into a POSIX timezone string at all.
For 2 reasons:
- there are 4 switches between Normal time and DST (not only 2)
- the switch dates are not fixed (due to moving Ramadan)
The perfect solution would be moving away from the POSIX tz strings whith all their disadvantages (https://www.ibm.com/developerworks/aix/library/au-aix-posix/)
and applying the RULES from the IANA database instead.
But that's a big development project!
Workaround is:
- select "Other"
- construct a tz string for the first period of DST (march until beginning of Ramadan)
- if Ramadan has started: change tz string for the second period of DST (end of Ramadan until october)
/Thomas