This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 8e9f5a8d3 nshlib/nsh_timcmds.c: fix incorrect time set during summer
time
8e9f5a8d3 is described below
commit 8e9f5a8d3aa318fb9b3fb67db3577fac7cf84116
Author: Michal Lenc <[email protected]>
AuthorDate: Fri Apr 17 11:57:40 2026 +0200
nshlib/nsh_timcmds.c: fix incorrect time set during summer time
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 <[email protected]>
---
nshlib/nsh_timcmds.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/nshlib/nsh_timcmds.c b/nshlib/nsh_timcmds.c
index a0952acc1..de5dd8adf 100644
--- a/nshlib/nsh_timcmds.c
+++ b/nshlib/nsh_timcmds.c
@@ -265,6 +265,10 @@ static inline int date_settime(FAR struct nsh_vtbl_s *vtbl,
tm.tm_year = (int)result - 1900;
+ /* Information about daylight saving not available -> let TZ handle it */
+
+ tm.tm_isdst = -1;
+
/* Convert this to the right form, then set the timer */
ts.tv_sec = utc ? timegm(&tm): mktime(&tm);