Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
b9f33830
Commit
b9f33830
authored
Jul 04, 2018
by
antirez
Browse files
Localtime: fix timezone adjustment.
parent
0c12cbed
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/localtime.c
View file @
b9f33830
...
@@ -56,7 +56,8 @@ void nolocks_localtime(struct tm *tmp, time_t t, time_t tz, int dst) {
...
@@ -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_hour
=
3600
;
const
time_t
secs_day
=
3600
*
24
;
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
days
=
t
/
secs_day
;
/* Days passed since epoch. */
time_t
seconds
=
t
%
secs_day
;
/* Remaining seconds. */
time_t
seconds
=
t
%
secs_day
;
/* Remaining seconds. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment