From: Ivan Kurnosov Date: Sun, 17 Sep 2017 11:09:38 +0000 (+1200) Subject: Fix for dst/non-dst timezones X-Git-Tag: v235~90^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e72b7945991f5cb7db3d24d3fe0179d21159d2c;p=thirdparty%2Fsystemd.git Fix for dst/non-dst timezones The problem was with the tm.tm_isdst that is set to the current environment value: either DST or not. While the current state is not relevant to the state in the desired date. Hence — it should be reset so that the mktime_or_timegm could normalise it later. --- diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 2577088c2f6..00979bfe594 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -735,11 +735,9 @@ static int parse_timestamp_impl(const char *t, usec_t *usec, bool with_tz) { if (!localtime_or_gmtime_r(&x, &tm, utc)) return -EINVAL; - if (!with_tz) { - tm.tm_isdst = dst; - if (tzn) - tm.tm_zone = tzn; - } + tm.tm_isdst = dst; + if (!with_tz && tzn) + tm.tm_zone = tzn; if (streq(t, "today")) { tm.tm_sec = tm.tm_min = tm.tm_hour = 0;