diff options
author | antirez <antirez@gmail.com> | 2018-07-04 13:35:15 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-07-04 13:35:15 +0200 |
commit | b9f33830295a78f8c5bb82f6caa033445d35e56e (patch) | |
tree | 039373ce2f9782b107f1db39551e410af8ab5638 /src/localtime.c | |
parent | 0c12cbedbb1626597acf2f43718c6b52fc42d08a (diff) | |
download | redis-b9f33830295a78f8c5bb82f6caa033445d35e56e.tar.gz |
Localtime: fix timezone adjustment.
Diffstat (limited to 'src/localtime.c')
-rw-r--r-- | src/localtime.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/localtime.c b/src/localtime.c index d4090e63c..536cb69e8 100644 --- a/src/localtime.c +++ b/src/localtime.c @@ -56,7 +56,8 @@ void nolocks_localtime(struct tm *tmp, time_t t, time_t tz, int dst) { const time_t secs_hour = 3600; const time_t secs_day = 3600*24; - t += tz; /* Adjust for timezone. */ + t -= tz; /* Adjust for timezone. */ + t += 3600+dst; /* Adjust for daylight time. */ time_t days = t / secs_day; /* Days passed since epoch. */ time_t seconds = t % secs_day; /* Remaining seconds. */ |