Daylight Savings Time Fix #21
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses an issue with the crossing of daylight savings time boundaries.
Specifically the test on line 912 skips the entire day of 3/10/2019 without the fix.
As I believe I understand the issue is as follows (for the test on line 912)
The code creates a struct tm on 3/9 and then as it works to locate the next time (which should be 3/10 at 6AM) - it sets the struct to 23:00 on 3/10 (to change days) but it has the isdst flag as 0.
Then the system (i.e. not this library) reads that time and readjusts the struct to 0 hours on 3/11 with the isdst flag as 1.
The code then zeros out the hours and tries to start looking for the next match. But it's jumped over the 10th due to the daylight savings jump, obviously not the desired situation.
Switching the isdst flag to -1 when we set a field allows the system to properly switch into the 10th and therefore the struct gets to the correct spot and works properly.