mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fixed the calculation of leap days in RtlTimeToTimeFields.
svn path=/trunk/; revision=3570
This commit is contained in:
parent
51ee9ffb3d
commit
7c651fda9c
1 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: time.c,v 1.12 2002/09/13 18:58:36 hbirr Exp $
|
||||
/* $Id: time.c,v 1.13 2002/09/27 15:23:03 hbirr Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -117,7 +117,7 @@ RtlTimeToTimeFields (
|
|||
CurYear--; /* The next calculation needs CurYear - 1 */
|
||||
Days += CurYear - CurYear / 4 + CurYear / 100 - CurYear / 400;
|
||||
CurYear++;
|
||||
Days -= EPOCHYEAR - EPOCHYEAR / 4 + EPOCHYEAR / 100 - EPOCHYEAR / 400;
|
||||
Days -= EPOCHYEAR - 1 - (EPOCHYEAR -1) / 4 + (EPOCHYEAR -1) / 100 - (EPOCHYEAR - 1) / 400;
|
||||
while (1)
|
||||
{
|
||||
LeapYear = IsLeapYear(CurYear);
|
||||
|
@ -131,6 +131,7 @@ RtlTimeToTimeFields (
|
|||
TimeFields->Year = (CSHORT) CurYear;
|
||||
|
||||
/* Compute month of year */
|
||||
LeapYear = IsLeapYear(CurYear);
|
||||
Months = MonthLengths[LeapYear];
|
||||
for (CurMonth = 0; Days >= (long) Months[CurMonth]; CurMonth++)
|
||||
Days = Days - (long) Months[CurMonth];
|
||||
|
|
Loading…
Reference in a new issue