Mitch, I have been programming in OOP for over 30 years.
When I posted, I did not have time then to track down the variables and types to find what to manipulate.
Last night I finally had some time to really look over the library code and it looks really good. I think its ready for github posting.
I should note the library works fine on the ESP8266 and ESP32 as well.
My clock code is Atomic(NTP) with WiFi on the ESP8266 with web setup. I plan a Fibonacci version soon. Either one i would offer as an example to add to the library if you like.
I did re-sequence some of the timezone.h file. For some reason on the ESP32, if setRule() is after toLocal() it had a hiccup. (Still not sure why) Send me an email if you want the full code. Mi ck ey AT Dat as oft LLC DOT co m (caps not needed)
class Timezone
{
public:
Timezone(TimeChangeRule dstStart, TimeChangeRule stdStart);
Timezone(int address);
void setRule(TimeChangeRule dstStart, TimeChangeRule stdStart);
time_t toLocal(time_t utc);
time_t toLocal(time_t utc, TimeChangeRule **tcr);
time_t toUTC(time_t local);
bool utcIsDST(time_t utc);
bool locIsDST(time_t local);
void readRules(int address);
void writeRules(int address);
private:
void calcTimeChanges(int yr);
time_t toTime_t(TimeChangeRule r, int yr);
TimeChangeRule _dst; //rule for start of dst or summer time for any year
TimeChangeRule _std; //rule for start of standard time for any year
TimeChangeRule _dstSave;
TimeChangeRule _stdSave;
time_t _dstUTC; //dst start for given/current year, given in UTC
time_t _stdUTC; //std time start for given/current year, given in UTC
time_t _dstLoc; //dst start for given/current year, given in local time
time_t _stdLoc; //std time start for given/current year, given in local time
};
#endif