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
c25ee35a
Commit
c25ee35a
authored
Jul 04, 2018
by
antirez
Browse files
Localtime: day of month is 1 based. Convert from 0 based "days".
parent
b9f33830
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/localtime.c
View file @
c25ee35a
...
@@ -94,6 +94,6 @@ void nolocks_localtime(struct tm *tmp, time_t t, time_t tz, int dst) {
...
@@ -94,6 +94,6 @@ void nolocks_localtime(struct tm *tmp, time_t t, time_t tz, int dst) {
tmp
->
tm_mon
++
;
tmp
->
tm_mon
++
;
}
}
tmp
->
tm_mday
=
days
;
tmp
->
tm_mday
=
days
+
1
;
/* Add 1 since our 'days' is zero-based. */
tmp
->
tm_year
-=
1900
;
/* Surprisingly tm_year is year-1900. */
tmp
->
tm_year
-=
1900
;
/* Surprisingly tm_year is year-1900. */
}
}
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