AceTime  2.2.0
Date and time classes for Arduino that support timezones from the TZ Database.
zone_policies.cpp
1 // This file was generated by the following script:
2 //
3 // $ /home/brian/src/AceTimeTools/src/acetimetools/tzcompiler.py
4 // --input_dir /home/brian/src/AceTime/src/tzonedb/tzfiles
5 // --output_dir /home/brian/src/AceTime/src/tzonedb
6 // --tz_version 2022g
7 // --action zonedb
8 // --language arduino
9 // --scope basic
10 // --db_namespace tzonedb
11 // --generate_int16_years
12 // --include_list include_list.txt
13 // --nocompress
14 // --start_year 1980
15 // --until_year 10000
16 //
17 // using the TZ Database files
18 //
19 // africa
20 // antarctica
21 // asia
22 // australasia
23 // backward
24 // etcetera
25 // europe
26 // northamerica
27 // southamerica
28 //
29 // from https://github.com/eggert/tz/releases/tag/2022g
30 //
31 // Supported Zones: 12 (11 zones, 1 links)
32 // Unsupported Zones: 584 (340 zones, 244 links)
33 //
34 // Original Years: [1844,2087]
35 // Generated Years: [1945,2007]
36 // Estimator Years: [1945,2009]
37 // Max Buffer Size: 6
38 //
39 // Records:
40 // Infos: 12
41 // Eras: 15
42 // Policies: 8
43 // Rules: 32
44 //
45 // Memory (8-bits):
46 // Rules: 352
47 // Policies: 24
48 // Eras: 180
49 // Zones: 143
50 // Links: 13
51 // Registry: 24
52 // Formats: 38
53 // Letters: 11
54 // Fragments: 0
55 // Names: 202 (original: 202)
56 // TOTAL: 987
57 //
58 // Memory (32-bits):
59 // Rules: 384
60 // Policies: 64
61 // Eras: 240
62 // Zones: 264
63 // Links: 24
64 // Registry: 48
65 // Formats: 38
66 // Letters: 17
67 // Fragments: 0
68 // Names: 202 (original: 202)
69 // TOTAL: 1281
70 //
71 // DO NOT EDIT
72 
73 #include <zoneinfo/compat.h>
74 #include "zone_policies.h"
75 
76 namespace ace_time {
77 namespace tzonedb {
78 
79 //---------------------------------------------------------------------------
80 // Policies: 8
81 // Rules: 32
82 //---------------------------------------------------------------------------
83 
84 //---------------------------------------------------------------------------
85 // Policy name: Aus
86 // Rules: 1
87 //---------------------------------------------------------------------------
88 
89 static const basic::ZoneRule kZoneRulesAus[] ACE_TIME_PROGMEM = {
90  // Anchor: Rule Aus 1943 1944 - Mar lastSun 2:00s 0 S
91  {
92  -32767 /*fromYear*/,
93  -32767 /*toYear*/,
94  1 /*inMonth*/,
95  0 /*onDayOfWeek*/,
96  1 /*onDayOfMonth*/,
97  0 /*atTimeCode*/,
98  0 /*atTimeModifier (kSuffixW + minute=0)*/,
99  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
100  2 /*letterIndex ("S")*/,
101  },
102 
103 };
104 
105 const basic::ZonePolicy kZonePolicyAus ACE_TIME_PROGMEM = {
106  kZoneRulesAus /*rules*/,
107  1 /*numRules*/,
108 };
109 
110 //---------------------------------------------------------------------------
111 // Policy name: Canada
112 // Rules: 7
113 //---------------------------------------------------------------------------
114 
115 static const basic::ZoneRule kZoneRulesCanada[] ACE_TIME_PROGMEM = {
116  // Anchor: Rule Canada 1945 only - Sep 30 2:00 0 S
117  {
118  -32767 /*fromYear*/,
119  -32767 /*toYear*/,
120  1 /*inMonth*/,
121  0 /*onDayOfWeek*/,
122  1 /*onDayOfMonth*/,
123  0 /*atTimeCode*/,
124  0 /*atTimeModifier (kSuffixW + minute=0)*/,
125  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
126  2 /*letterIndex ("S")*/,
127  },
128  // Rule Canada 1945 only - Sep 30 2:00 0 S
129  {
130  1945 /*fromYear*/,
131  1945 /*toYear*/,
132  9 /*inMonth*/,
133  0 /*onDayOfWeek*/,
134  30 /*onDayOfMonth*/,
135  8 /*atTimeCode*/,
136  0 /*atTimeModifier (kSuffixW + minute=0)*/,
137  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
138  2 /*letterIndex ("S")*/,
139  },
140  // Rule Canada 1974 1986 - Apr lastSun 2:00 1:00 D
141  {
142  1974 /*fromYear*/,
143  1986 /*toYear*/,
144  4 /*inMonth*/,
145  7 /*onDayOfWeek*/,
146  0 /*onDayOfMonth*/,
147  8 /*atTimeCode*/,
148  0 /*atTimeModifier (kSuffixW + minute=0)*/,
149  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
150  1 /*letterIndex ("D")*/,
151  },
152  // Rule Canada 1974 2006 - Oct lastSun 2:00 0 S
153  {
154  1974 /*fromYear*/,
155  2006 /*toYear*/,
156  10 /*inMonth*/,
157  7 /*onDayOfWeek*/,
158  0 /*onDayOfMonth*/,
159  8 /*atTimeCode*/,
160  0 /*atTimeModifier (kSuffixW + minute=0)*/,
161  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
162  2 /*letterIndex ("S")*/,
163  },
164  // Rule Canada 1987 2006 - Apr Sun>=1 2:00 1:00 D
165  {
166  1987 /*fromYear*/,
167  2006 /*toYear*/,
168  4 /*inMonth*/,
169  7 /*onDayOfWeek*/,
170  1 /*onDayOfMonth*/,
171  8 /*atTimeCode*/,
172  0 /*atTimeModifier (kSuffixW + minute=0)*/,
173  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
174  1 /*letterIndex ("D")*/,
175  },
176  // Rule Canada 2007 max - Mar Sun>=8 2:00 1:00 D
177  {
178  2007 /*fromYear*/,
179  32766 /*toYear*/,
180  3 /*inMonth*/,
181  7 /*onDayOfWeek*/,
182  8 /*onDayOfMonth*/,
183  8 /*atTimeCode*/,
184  0 /*atTimeModifier (kSuffixW + minute=0)*/,
185  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
186  1 /*letterIndex ("D")*/,
187  },
188  // Rule Canada 2007 max - Nov Sun>=1 2:00 0 S
189  {
190  2007 /*fromYear*/,
191  32766 /*toYear*/,
192  11 /*inMonth*/,
193  7 /*onDayOfWeek*/,
194  1 /*onDayOfMonth*/,
195  8 /*atTimeCode*/,
196  0 /*atTimeModifier (kSuffixW + minute=0)*/,
197  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
198  2 /*letterIndex ("S")*/,
199  },
200 
201 };
202 
203 const basic::ZonePolicy kZonePolicyCanada ACE_TIME_PROGMEM = {
204  kZoneRulesCanada /*rules*/,
205  7 /*numRules*/,
206 };
207 
208 //---------------------------------------------------------------------------
209 // Policy name: Ecuador
210 // Rules: 3
211 //---------------------------------------------------------------------------
212 
213 static const basic::ZoneRule kZoneRulesEcuador[] ACE_TIME_PROGMEM = {
214  // Anchor: Rule Ecuador 1993 only - Feb 5 0:00 0 -
215  {
216  -32767 /*fromYear*/,
217  -32767 /*toYear*/,
218  1 /*inMonth*/,
219  0 /*onDayOfWeek*/,
220  1 /*onDayOfMonth*/,
221  0 /*atTimeCode*/,
222  0 /*atTimeModifier (kSuffixW + minute=0)*/,
223  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
224  0 /*letterIndex ("")*/,
225  },
226  // Rule Ecuador 1992 only - Nov 28 0:00 1:00 -
227  {
228  1992 /*fromYear*/,
229  1992 /*toYear*/,
230  11 /*inMonth*/,
231  0 /*onDayOfWeek*/,
232  28 /*onDayOfMonth*/,
233  0 /*atTimeCode*/,
234  0 /*atTimeModifier (kSuffixW + minute=0)*/,
235  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
236  0 /*letterIndex ("")*/,
237  },
238  // Rule Ecuador 1993 only - Feb 5 0:00 0 -
239  {
240  1993 /*fromYear*/,
241  1993 /*toYear*/,
242  2 /*inMonth*/,
243  0 /*onDayOfWeek*/,
244  5 /*onDayOfMonth*/,
245  0 /*atTimeCode*/,
246  0 /*atTimeModifier (kSuffixW + minute=0)*/,
247  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
248  0 /*letterIndex ("")*/,
249  },
250 
251 };
252 
253 const basic::ZonePolicy kZonePolicyEcuador ACE_TIME_PROGMEM = {
254  kZoneRulesEcuador /*rules*/,
255  3 /*numRules*/,
256 };
257 
258 //---------------------------------------------------------------------------
259 // Policy name: Edm
260 // Rules: 4
261 //---------------------------------------------------------------------------
262 
263 static const basic::ZoneRule kZoneRulesEdm[] ACE_TIME_PROGMEM = {
264  // Anchor: Rule Edm 1947 only - Sep lastSun 2:00 0 S
265  {
266  -32767 /*fromYear*/,
267  -32767 /*toYear*/,
268  1 /*inMonth*/,
269  0 /*onDayOfWeek*/,
270  1 /*onDayOfMonth*/,
271  0 /*atTimeCode*/,
272  0 /*atTimeModifier (kSuffixW + minute=0)*/,
273  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
274  2 /*letterIndex ("S")*/,
275  },
276  // Rule Edm 1947 only - Sep lastSun 2:00 0 S
277  {
278  1947 /*fromYear*/,
279  1947 /*toYear*/,
280  9 /*inMonth*/,
281  7 /*onDayOfWeek*/,
282  0 /*onDayOfMonth*/,
283  8 /*atTimeCode*/,
284  0 /*atTimeModifier (kSuffixW + minute=0)*/,
285  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
286  2 /*letterIndex ("S")*/,
287  },
288  // Rule Edm 1972 1986 - Apr lastSun 2:00 1:00 D
289  {
290  1972 /*fromYear*/,
291  1986 /*toYear*/,
292  4 /*inMonth*/,
293  7 /*onDayOfWeek*/,
294  0 /*onDayOfMonth*/,
295  8 /*atTimeCode*/,
296  0 /*atTimeModifier (kSuffixW + minute=0)*/,
297  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
298  1 /*letterIndex ("D")*/,
299  },
300  // Rule Edm 1972 2006 - Oct lastSun 2:00 0 S
301  {
302  1972 /*fromYear*/,
303  2006 /*toYear*/,
304  10 /*inMonth*/,
305  7 /*onDayOfWeek*/,
306  0 /*onDayOfMonth*/,
307  8 /*atTimeCode*/,
308  0 /*atTimeModifier (kSuffixW + minute=0)*/,
309  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
310  2 /*letterIndex ("S")*/,
311  },
312 
313 };
314 
315 const basic::ZonePolicy kZonePolicyEdm ACE_TIME_PROGMEM = {
316  kZoneRulesEdm /*rules*/,
317  4 /*numRules*/,
318 };
319 
320 //---------------------------------------------------------------------------
321 // Policy name: SA
322 // Rules: 1
323 //---------------------------------------------------------------------------
324 
325 static const basic::ZoneRule kZoneRulesSA[] ACE_TIME_PROGMEM = {
326  // Anchor: Rule SA 1943 1944 - Mar Sun>=15 2:00 0 -
327  {
328  -32767 /*fromYear*/,
329  -32767 /*toYear*/,
330  1 /*inMonth*/,
331  0 /*onDayOfWeek*/,
332  1 /*onDayOfMonth*/,
333  0 /*atTimeCode*/,
334  0 /*atTimeModifier (kSuffixW + minute=0)*/,
335  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
336  0 /*letterIndex ("")*/,
337  },
338 
339 };
340 
341 const basic::ZonePolicy kZonePolicySA ACE_TIME_PROGMEM = {
342  kZoneRulesSA /*rules*/,
343  1 /*numRules*/,
344 };
345 
346 //---------------------------------------------------------------------------
347 // Policy name: US
348 // Rules: 7
349 //---------------------------------------------------------------------------
350 
351 static const basic::ZoneRule kZoneRulesUS[] ACE_TIME_PROGMEM = {
352  // Anchor: Rule US 1967 2006 - Oct lastSun 2:00 0 S
353  {
354  -32767 /*fromYear*/,
355  -32767 /*toYear*/,
356  1 /*inMonth*/,
357  0 /*onDayOfWeek*/,
358  1 /*onDayOfMonth*/,
359  0 /*atTimeCode*/,
360  0 /*atTimeModifier (kSuffixW + minute=0)*/,
361  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
362  2 /*letterIndex ("S")*/,
363  },
364  // Rule US 1967 2006 - Oct lastSun 2:00 0 S
365  {
366  1967 /*fromYear*/,
367  2006 /*toYear*/,
368  10 /*inMonth*/,
369  7 /*onDayOfWeek*/,
370  0 /*onDayOfMonth*/,
371  8 /*atTimeCode*/,
372  0 /*atTimeModifier (kSuffixW + minute=0)*/,
373  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
374  2 /*letterIndex ("S")*/,
375  },
376  // Rule US 1975 only - Feb lastSun 2:00 1:00 D
377  {
378  1975 /*fromYear*/,
379  1975 /*toYear*/,
380  2 /*inMonth*/,
381  7 /*onDayOfWeek*/,
382  0 /*onDayOfMonth*/,
383  8 /*atTimeCode*/,
384  0 /*atTimeModifier (kSuffixW + minute=0)*/,
385  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
386  1 /*letterIndex ("D")*/,
387  },
388  // Rule US 1976 1986 - Apr lastSun 2:00 1:00 D
389  {
390  1976 /*fromYear*/,
391  1986 /*toYear*/,
392  4 /*inMonth*/,
393  7 /*onDayOfWeek*/,
394  0 /*onDayOfMonth*/,
395  8 /*atTimeCode*/,
396  0 /*atTimeModifier (kSuffixW + minute=0)*/,
397  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
398  1 /*letterIndex ("D")*/,
399  },
400  // Rule US 1987 2006 - Apr Sun>=1 2:00 1:00 D
401  {
402  1987 /*fromYear*/,
403  2006 /*toYear*/,
404  4 /*inMonth*/,
405  7 /*onDayOfWeek*/,
406  1 /*onDayOfMonth*/,
407  8 /*atTimeCode*/,
408  0 /*atTimeModifier (kSuffixW + minute=0)*/,
409  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
410  1 /*letterIndex ("D")*/,
411  },
412  // Rule US 2007 max - Mar Sun>=8 2:00 1:00 D
413  {
414  2007 /*fromYear*/,
415  32766 /*toYear*/,
416  3 /*inMonth*/,
417  7 /*onDayOfWeek*/,
418  8 /*onDayOfMonth*/,
419  8 /*atTimeCode*/,
420  0 /*atTimeModifier (kSuffixW + minute=0)*/,
421  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
422  1 /*letterIndex ("D")*/,
423  },
424  // Rule US 2007 max - Nov Sun>=1 2:00 0 S
425  {
426  2007 /*fromYear*/,
427  32766 /*toYear*/,
428  11 /*inMonth*/,
429  7 /*onDayOfWeek*/,
430  1 /*onDayOfMonth*/,
431  8 /*atTimeCode*/,
432  0 /*atTimeModifier (kSuffixW + minute=0)*/,
433  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
434  2 /*letterIndex ("S")*/,
435  },
436 
437 };
438 
439 const basic::ZonePolicy kZonePolicyUS ACE_TIME_PROGMEM = {
440  kZoneRulesUS /*rules*/,
441  7 /*numRules*/,
442 };
443 
444 //---------------------------------------------------------------------------
445 // Policy name: Vanc
446 // Rules: 4
447 //---------------------------------------------------------------------------
448 
449 static const basic::ZoneRule kZoneRulesVanc[] ACE_TIME_PROGMEM = {
450  // Anchor: Rule Vanc 1947 1961 - Sep lastSun 2:00 0 S
451  {
452  -32767 /*fromYear*/,
453  -32767 /*toYear*/,
454  1 /*inMonth*/,
455  0 /*onDayOfWeek*/,
456  1 /*onDayOfMonth*/,
457  0 /*atTimeCode*/,
458  0 /*atTimeModifier (kSuffixW + minute=0)*/,
459  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
460  2 /*letterIndex ("S")*/,
461  },
462  // Rule Vanc 1946 1986 - Apr lastSun 2:00 1:00 D
463  {
464  1946 /*fromYear*/,
465  1986 /*toYear*/,
466  4 /*inMonth*/,
467  7 /*onDayOfWeek*/,
468  0 /*onDayOfMonth*/,
469  8 /*atTimeCode*/,
470  0 /*atTimeModifier (kSuffixW + minute=0)*/,
471  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
472  1 /*letterIndex ("D")*/,
473  },
474  // Rule Vanc 1947 1961 - Sep lastSun 2:00 0 S
475  {
476  1947 /*fromYear*/,
477  1961 /*toYear*/,
478  9 /*inMonth*/,
479  7 /*onDayOfWeek*/,
480  0 /*onDayOfMonth*/,
481  8 /*atTimeCode*/,
482  0 /*atTimeModifier (kSuffixW + minute=0)*/,
483  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
484  2 /*letterIndex ("S")*/,
485  },
486  // Rule Vanc 1962 2006 - Oct lastSun 2:00 0 S
487  {
488  1962 /*fromYear*/,
489  2006 /*toYear*/,
490  10 /*inMonth*/,
491  7 /*onDayOfWeek*/,
492  0 /*onDayOfMonth*/,
493  8 /*atTimeCode*/,
494  0 /*atTimeModifier (kSuffixW + minute=0)*/,
495  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
496  2 /*letterIndex ("S")*/,
497  },
498 
499 };
500 
501 const basic::ZonePolicy kZonePolicyVanc ACE_TIME_PROGMEM = {
502  kZoneRulesVanc /*rules*/,
503  4 /*numRules*/,
504 };
505 
506 //---------------------------------------------------------------------------
507 // Policy name: Winn
508 // Rules: 5
509 //---------------------------------------------------------------------------
510 
511 static const basic::ZoneRule kZoneRulesWinn[] ACE_TIME_PROGMEM = {
512  // Anchor: Rule Winn 1963 only - Sep 22 2:00 0 S
513  {
514  -32767 /*fromYear*/,
515  -32767 /*toYear*/,
516  1 /*inMonth*/,
517  0 /*onDayOfWeek*/,
518  1 /*onDayOfMonth*/,
519  0 /*atTimeCode*/,
520  0 /*atTimeModifier (kSuffixW + minute=0)*/,
521  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
522  2 /*letterIndex ("S")*/,
523  },
524  // Rule Winn 1963 only - Sep 22 2:00 0 S
525  {
526  1963 /*fromYear*/,
527  1963 /*toYear*/,
528  9 /*inMonth*/,
529  0 /*onDayOfWeek*/,
530  22 /*onDayOfMonth*/,
531  8 /*atTimeCode*/,
532  0 /*atTimeModifier (kSuffixW + minute=0)*/,
533  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
534  2 /*letterIndex ("S")*/,
535  },
536  // Rule Winn 1966 1986 - Apr lastSun 2:00s 1:00 D
537  {
538  1966 /*fromYear*/,
539  1986 /*toYear*/,
540  4 /*inMonth*/,
541  7 /*onDayOfWeek*/,
542  0 /*onDayOfMonth*/,
543  8 /*atTimeCode*/,
544  16 /*atTimeModifier (kSuffixS + minute=0)*/,
545  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
546  1 /*letterIndex ("D")*/,
547  },
548  // Rule Winn 1966 2005 - Oct lastSun 2:00s 0 S
549  {
550  1966 /*fromYear*/,
551  2005 /*toYear*/,
552  10 /*inMonth*/,
553  7 /*onDayOfWeek*/,
554  0 /*onDayOfMonth*/,
555  8 /*atTimeCode*/,
556  16 /*atTimeModifier (kSuffixS + minute=0)*/,
557  4 /*deltaCode ((deltaMinutes=0)/15 + 4)*/,
558  2 /*letterIndex ("S")*/,
559  },
560  // Rule Winn 1987 2005 - Apr Sun>=1 2:00s 1:00 D
561  {
562  1987 /*fromYear*/,
563  2005 /*toYear*/,
564  4 /*inMonth*/,
565  7 /*onDayOfWeek*/,
566  1 /*onDayOfMonth*/,
567  8 /*atTimeCode*/,
568  16 /*atTimeModifier (kSuffixS + minute=0)*/,
569  8 /*deltaCode ((deltaMinutes=60)/15 + 4)*/,
570  1 /*letterIndex ("D")*/,
571  },
572 
573 };
574 
575 const basic::ZonePolicy kZonePolicyWinn ACE_TIME_PROGMEM = {
576  kZoneRulesWinn /*rules*/,
577  5 /*numRules*/,
578 };
579 
580 
581 
582 }
583 }
Macros and definitions that provide a consistency layer among the various Arduino boards for compatib...