mirror of
https://github.com/fluencelabs/redis
synced 2025-04-25 10:32:14 +00:00
Localtime: fix timezone adjustment.
This commit is contained in:
parent
0c12cbedbb
commit
b9f3383029
@ -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. */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user