Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Daylight Saving Time support #1058
Implements initial Daylight Saving Time (DST) API proposed in #211.
Added Wiring functions:
/* Retrieve the current DST offset that is added to the current local time when * Time.beginDST() has been called. * The default is 1 hour. */ float TimeClass::getDSTOffset(); /* Set a custom DST offset */ void TimeClass::setDSTOffset(float offset); /* Add the offset from getDSTOffset() to the current time */ void TimeClass::beginDST(); /* Do not add the offset from getDSTOffset() to the current time */ void TimeClass::endDST(); /* Returns true if DST is in effect (beginDST() was called previously) */ uint8_t TimeClass::isDST();
I'm not sure how this will actually address the issue of switching DST on and off
In #211 there was talk about a way to set the switching pattern
But I can't see any way to set an auto-switching pattern in the docs or in this PR, but that would seem to be the only thing that we are actually missing.
BTW, these values (zone, DSTOffset and the swtiching rules) should be made sticky too, to add value, otherwise we could dump (
Without the ability to set switching rules (actually not switching rules but ranges to automatically check agains to apply DST or not whenever a time is requested) and persisting the settings the whole "enhancement" here is worth little - IMHO.
Oh, i didn't realize that this DST implementation wouldn't automatically switch on and off based on the calendar! Unfortunately I have to agree - an implementation for adding or subtracting amounts of an hour from the current time won't help us very much as product developers.
Right now we're manually mimicking DST by changing the
Is there a gameplan for an automatically adjusting time based on DST calendar rules? Virtually every ioT product in the world needs this.