Skip to content

Commit d3425bd

Browse files
committed
[Issue #272] if timezone offset is not specified, treat it as local timezone
1 parent 6c21833 commit d3425bd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/configuration.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,8 +1223,10 @@ 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-
/* set timezone to UTC */
1227-
setenv("TZ", "UTC", 1);
1226+
/* if tz is not set, treat it as local timezone */
1227+
if (tz_set)
1228+
/* set timezone to UTC */
1229+
setenv("TZ", "UTC", 1);
12281230

12291231
/* convert time to utc unix time */
12301232
*result = mktime(&tm);

0 commit comments

Comments
 (0)