/* Next, complete months in current year */
{
int8 month = tm->month;
while ( --month >= 0 )//这里有没错呢?你先把一个月减了
//是不是少计数了一个月
{
days += monthLength( IsLeapYear( tm->year ), month );
}
}
/* Next, complete years before current year */
{
uint16 year = tm->year;
while ( --year >= BEGYEAR )
{
days += YearLength( year );
}
}
问题是在这里将时间数据由 UTCTimeStruct转换为UTCtime时间对月份和年循环条件。比如--year>=BEGYEAR是不是上算了一年。