3 ms·
For people wondering why Morocco has DST (which isn’t that useful for countries relatively close to the equator?), it seems Morocco chose to permanently become
by signal11 5y ago
For people wondering why Morocco has DST (which isn’t that useful for countries relatively close to the equator?), it seems Morocco chose to permanently become UTC+1 in 2018, with the exception of Ramadan, when it’s UTC.
So it’s not really DST in the summer months as done in Europe.
Although the Moroccan approach makes for an interesting technical challenge!
- shagie 5y agoSearching for Ramadan in https://github.com/eggert/tz/blob/main/asia https://github.com/eggert/tz/blob/main/asia and https://github.com/eggert/tz/blob/main/africa https://github.com/eggert/tz/blob/main/africa is an interesting read. Morocco textual history is at https://github.com/eggert/tz/blob/main/africa#L628 https://github.com/eggert/tz/blob/main/africa#L628 and the implementation rules are at https://github.com/eggert/tz/blob/main/africa#L903 https://github.com/eggert/tz/blob/main/africa#L903 Just above that is this bit: # From Paul Eggert (2020-05-31): # For now, guess that in the future Morocco will fall back at 03:00 # the last Sunday before Ramadan, and spring forward at 02:00 the # first Sunday after two days after Ramadan. To implement this, # transition dates and times for 2019 through 2087 were determined by # running the following program under GNU Emacs 26.3. (This algorithm # also produces the correct transition dates for 2016 through 2018, # though the times differ due to Morocco's time zone change in 2018.) # (let ((islamic-year 1440)) # (require 'cal-islam) # (while (< islamic-year 1511) # (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) # (b (+ 2 (calendar-islamic-to-absolute (list 10 1 islamic-year)))) # (sunday 0)) # (while (/= sunday (mod (setq a (1- a)) 7))) # (while (/= sunday (mod b 7)) # (setq b (1+ b))) # (setq a (calendar-gregorian-from-absolute a)) # (setq b (calendar-gregorian-from-absolute b)) # (insert # (format # (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t-1:00\t-\n" # "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t0\t-\n") # (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) # (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) # (setq islamic-year (+ 1 islamic-year))))
- h2odragon 5y agoI was sortof idly wondering the other day if anyone had "done" holiday calendar calculations in an easy library yet, or if emacs was still the best source. This argues emacs calendar is the gold standard implementation.
- gerikson 5y agoMorocco isn't that far south, it's on the same latitude as the American South. I missed them being on permanent "summer time" (UTC+1) except Ramadan. Our customers deal with contact centers and they do a lot of business with France, so this is major headache for them.