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