Correct the calculation of the year for the 31'st of December of leap
years.
This commit is contained in:
parent
dc78e9a595
commit
62ec238792
|
@ -449,6 +449,7 @@ VOID WINAPI RtlTimeToTimeFields(
|
||||||
TimeFields->Year += DeltaYear * 4;
|
TimeFields->Year += DeltaYear * 4;
|
||||||
Days -= DeltaYear * DAYSPERNORMALQUADRENNIUM;
|
Days -= DeltaYear * DAYSPERNORMALQUADRENNIUM;
|
||||||
DeltaYear = Days / DAYSPERNORMALYEAR;
|
DeltaYear = Days / DAYSPERNORMALYEAR;
|
||||||
|
if( DeltaYear > 3) DeltaYear = 3; /* fix 31 Dec of every leap year */
|
||||||
TimeFields->Year += DeltaYear;
|
TimeFields->Year += DeltaYear;
|
||||||
Days -= DeltaYear * DAYSPERNORMALYEAR;
|
Days -= DeltaYear * DAYSPERNORMALYEAR;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue