From a0305d754fb03f87495c1f074f07ee5dbb2fbd6f Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Thu, 1 Aug 2019 07:19:14 +0200 Subject: DST: fix date_change() thoroughly Explicit setting of Daylight Saving Time should be avoided before as well as after the mktime() call. Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/utils.c b/src/utils.c index 8a8de75..a9a9e68 100644 --- a/src/utils.c +++ b/src/utils.c @@ -525,10 +525,11 @@ int date_change(struct tm *date, int delta_month, int delta_day) t = *date; t.tm_mon += delta_month; t.tm_mday += delta_day; - + t.tm_isdst = -1; if (mktime(&t) == -1) { return 1; } else { + t.tm_isdst = -1; *date = t; return 0; } -- cgit v1.2.3-70-g09d2