Training sessions going past midnight "desync" the calendars
It took me a while yesterday to figure out what's wrong and how I could revert it on newer saves to not lose progress. This is what I've deducted.
I use a Lua mod that displays the Lua calendar's date and time on the HUD. There's always been an issue with the date in it being offset by -1 day compared to the game calendar. But I have found an easy fix a year ago, just removing "- 1" at the end of line 43 or adding "+ 1" at the end of line 53 in openmw_aux/calendar.lua fixes it.
Great, the dates are matching, everything is fine. But yesterday I've noticed that suddenly the date was offset by -3 or -4 days, depending on if I was using my "fix".
Now to the point. I tried to remember what I did in-game that could've triggered this weird behaviour. It was training. If training passes time over the 0:00 mark, weird stuff happens. The time in both the wait window and the Lua calendar looks normal. The date on the other hand only advances in the wait window. Wait for 24 hours and both calendars go 1 day forward normally but the offset stays.
Fortunately I've found a workaround to not get affected by this and a console command fix for already affected saves. Starting training at 0:01 AM and going safely without reaching midnight, then waiting for the next day and training again if needed. Using "Set DaysPassed to ( DaysPassed + n )" fixes the -n offset caused by the training problem and possibly (not sure) the base offset without touching calendar.lua.
I think training in Morrowind uses "Set GameHour to ( GameHour + n ) instead of passing time like the wait window for example. Using this command has exactly the same result in the Lua calendar, it stops the date from advancing past midnight.
I'm not a programmer, I don't know if this is intended behaviour of the OpenMW calendar or if it can be fixed. Just pointing this and the base -1 offset between the calendars out.