When using the TimeZone library, rules for DST are defined as:
TimeChangeRule myRule = {abbrev, week, dow, month, hour, offset};
For convenience, the following symbolic names can be used:
week: First, Second, Third, Fourth, Last
dow: Sun, Mon, Tue, Wed, Thu, Fri, Sat
month: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
My problem is with week.
Looking at the TimeZone database, some rules are defined as:
Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
US 2007 max - Mar Sun>=8 2:00 1:00 D
US 2007 max - Nov Sun>=1 2:00 0 S
In the "TO" column, >= means that the day of the month must be >= the number. It doesn't take a genius to figure out that Sun>=1 means "the first Sunday" and Sun>=8 means "the second Sunday".
However, it's not always that easy. The rule for Chile is:
Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Chile 2019 max - Apr Sun>=2 3:00u 0 -
Chile 2019 max - Sep Sun>=2 4:00u 1:00 -
So, this means that the time usually changes on the first Sunday of the month, but sometimes on the second Sunday. For example, the first Sunday in September 2024 is the 1st, so time will change there on the second Sunday.
Similarly, for Paraguay:
Para 2010 max - Oct Sun>=1 0:00 1:00 -
Para 2013 max - Mar Sun>=22 0:00 0 -
and for Israel:
Zion 2013 max - Mar Fri>=23 2:00 1:00 D
Zion 2013 max - Oct lastSun 2:00 0 S
Can such rules be defined using the TImeZone library and if so, what is the syntax?
Thanks!