nshlib/nsh_timcmds.c: fix incorrect time set during summer time#3458
Merged
acassis merged 1 commit intoapache:masterfrom Apr 17, 2026
Merged
nshlib/nsh_timcmds.c: fix incorrect time set during summer time#3458acassis merged 1 commit intoapache:masterfrom
acassis merged 1 commit intoapache:masterfrom
Conversation
Value zero in tm_isdst means daylight saving time (or summer time) is not in effect. This is obviously not true for half of the year in most timezones and keeping it at zero leads to incorrect time being set. This commit sets tm_isdst to -1, which means the information is not available and it should be handled according to timezone rules. Signed-off-by: Michal Lenc <michallenc@seznam.cz>
simbit18
approved these changes
Apr 17, 2026
acassis
approved these changes
Apr 17, 2026
Contributor
acassis
left a comment
There was a problem hiding this comment.
@michallenc nice finding!
linguini1
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Value zero in
tm_isdstmeans daylight saving time (or summer time) is not in effect. This is obviously not true for half of the year in most timezones and keeping it at zero leads to incorrect time being set. This commit setstm_isdstto -1, which means the information is not available and it should be handled according to timezone rules.Impact
Fixes time set with
datecommand.Testing
On custom device with Europe/Prague (UTC+2 now in summer time, otherwise UTC+1) timezone set.
Before the fix -> both local and UTC time not correctly set:
After the fix (tested both with and without daylight saving):
Tests if no timezone is uploaded