1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-01-18 11:22:41 +02:00

[Issue #272] if timezone offset is not specified, treat it as local timezone

This commit is contained in:
Grigory Smolkin 2020-12-02 18:17:31 +03:00
parent 6c21833a17
commit d3425bdc88

View File

@ -1223,8 +1223,10 @@ parse_time(const char *value, time_t *result, bool utc_default)
/* determine whether Daylight Saving Time is in effect */
tm.tm_isdst = -1;
/* set timezone to UTC */
setenv("TZ", "UTC", 1);
/* if tz is not set, treat it as local timezone */
if (tz_set)
/* set timezone to UTC */
setenv("TZ", "UTC", 1);
/* convert time to utc unix time */
*result = mktime(&tm);