mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-09-27 19:46:27 -05:00
coreinit: fix OSTicksToCalendarTime accuracy w/ leap years
This commit is contained in:
@@ -139,6 +139,7 @@ namespace coreinit
|
||||
|
||||
// calculate month and day
|
||||
uint32 dayInYear = (uint32)(daysSince0AD - yearStartDay);
|
||||
uint32 dayOfYear = dayInYear; // dayInYear gets shifted below to index the non-leap month table, so keep a copy
|
||||
bool isLeapYear = IsLeapYear(year);
|
||||
|
||||
uint32 month = 0; // 0-11
|
||||
@@ -239,7 +240,7 @@ namespace coreinit
|
||||
}
|
||||
}
|
||||
|
||||
calenderStruct->dayOfYear = dayInYear;
|
||||
calenderStruct->dayOfYear = dayOfYear;
|
||||
calenderStruct->month = month;
|
||||
calenderStruct->dayOfMonth = dayInMonth + 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user