Fix a typo of macro name
When the date is 28 Feb in the local timezone and 27 in the UTC, the leap second info is wrongly calculated, and the Time for 1 Mar created with a timezone resulted in an invalid date, 30 Feb.
This commit is contained in:
parent
1cb6790533
commit
32f356e84a
2
time.c
2
time.c
@ -1110,7 +1110,7 @@ gmtime_with_leapsecond(const time_t *timep, struct tm *result)
|
|||||||
result->tm_yday = leap_year_p(result->tm_year + 1900) ? 365 : 364;
|
result->tm_yday = leap_year_p(result->tm_year + 1900) ? 365 : 364;
|
||||||
}
|
}
|
||||||
else if (result->tm_mday == 1) {
|
else if (result->tm_mday == 1) {
|
||||||
const int8_t *days_in_month = days_in_month_of(result->tm_year + 1900);
|
const int8_t *days_in_month = days_in_month_in(result->tm_year + 1900);
|
||||||
result->tm_mon--;
|
result->tm_mon--;
|
||||||
result->tm_mday = days_in_month[result->tm_mon];
|
result->tm_mday = days_in_month[result->tm_mon];
|
||||||
result->tm_yday--;
|
result->tm_yday--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user