Commit 29644144 authored by antirez's avatar antirez
Browse files

Localtime: fix comment about leap year.

parent 0ea39aa4
...@@ -79,7 +79,7 @@ void nolocks_localtime(struct tm *tmp, time_t t, time_t tz, int dst) { ...@@ -79,7 +79,7 @@ void nolocks_localtime(struct tm *tmp, time_t t, time_t tz, int dst) {
/* Calculate the current year. */ /* Calculate the current year. */
tmp->tm_year = 1970; tmp->tm_year = 1970;
while(1) { while(1) {
/* Leap years have one year more. */ /* Leap years have one day more. */
time_t days_this_year = 365 + is_leap_year(tmp->tm_year); time_t days_this_year = 365 + is_leap_year(tmp->tm_year);
if (days_this_year > days) break; if (days_this_year > days) break;
days -= days_this_year; days -= days_this_year;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment