Bare with me I'm a C guy not a C++ guy so my object knowledge is lacking. I'm using the simpleDSTadjust library on an esp8266 project i'm working on and I've creased a web page to adjust the DST settings. I'm able to adjust the settings and store them into the SPIFFS system as well as load those settings into variables in my code. The problem is now do I update the "DstRules" dynamically. I have a board I'm making that will be going out to multiple people and I want them to be able to adjust their dst settings without hard coding each board individually.
Here is a snippet of code from my work file:
#include <ESP8266WiFi.h>
#include <Ticker.h>
#include <time.h>
#include <simpleDSTadjust.h>
#define timezone -5 // US Eastern Time Zone
struct dstRule StartRule = {"EDT", Second, Sun, Mar, 2, 3600}; // Daylight time = UTC/GMT -4 hours
struct dstRule EndRule = {"EST", First, Sun, Nov, 2, 0}; // Standard time = UTC/GMT -5 hour
// Setup simpleDSTadjust Library rules
simpleDSTadjust dstAdjusted(StartRule, EndRule);
void setup() {
/****************************
*Here is where I want to update the StartRule and the EndRule and change it from EDT to say CDT
so i want to change the the
StartRule = {"CDT", Second, Sun, Mar, 2, 1800}; // Daylight time = 30 minutes off CST
EndRule = {"CST", First, Sun, Nov, 2, 0}; // Standard CST time
****************************/
updateNTP(); // Init the NTP time
printTime(0); // print initial time time now.
}
I throw an error on both the StaruRule and EndRule in the setup function via the compiler if I try to do this.