mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-05 13:20:11 +00:00
gmtime, localtime, mktime, strftime and asctime took and returned the host std::tm. The guest's FreeBSD tm has tm_gmtoff and tm_zone after the nine calendar fields, so on Windows, where std::tm is 36 bytes, a title reading those fields read past the thread-local result, and gmtime_s left them unwritten. Windows gmtime_s also accepts only 1969-12-31 12:00 to 3001-01-19 21:59 UTC, where the guest libc converts any time. Convert through a GuestTm with the guest layout on both hosts. Compute the UTC fields from the day count, so every time whose year fits an int converts, and on Windows take the local offset and zone name from the CRT. gmtime reports the zone as UTC like the guest libc. localtime and mktime keep the CRT's range on Windows; recorded in TechnicalDebt. Co-Authored-By: Claude Fable 5.1 <[email protected]>