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.
This commit is contained in:
parent
a3da4a3d0a
commit
2e72b79459
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue