Commit c25ee35a authored by antirez's avatar antirez
Browse files

Localtime: day of month is 1 based. Convert from 0 based "days".

parent b9f33830
...@@ -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. */
} }
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