Skip to content

Commit b6ce030

Browse files
committed
Timestamps with missing timezone offset should be treated as UTC only when parsing config(due to some old bug), otherwise as local timezone
1 parent 50d2d9c commit b6ce030

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/utils/configuration.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,8 +1223,11 @@ parse_time(const char *value, time_t *result, bool utc_default)
12231223
/* determine whether Daylight Saving Time is in effect */
12241224
tm.tm_isdst = -1;
12251225

1226-
/* if tz is not set, treat it as local timezone */
1227-
if (tz_set)
1226+
/*
1227+
* If tz is not set,
1228+
* treat it as UTC if requested, otherwise as local timezone
1229+
*/
1230+
if (tz_set || utc_default)
12281231
/* set timezone to UTC */
12291232
setenv("TZ", "UTC", 1);
12301233

0 commit comments

Comments
 (0)