fix(libSceRtc): retain Windows offsets across the supported date range #4939
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4939"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by QRMOE on 2026-10-13T05:42:37Z.
What
Keep the configured host time-zone offset when libSceRtc converts valid dates outside the Windows CRT's time range. Main calls the host
localtime_s, treats a rejected date as an offset of zero, and reports UTC instead of the selected zone for dates before 1970 or after January 3001. For example,1969-12-31T23:59:59.50inXXX-5:30should format as1970-01-01T05:29:59.50+05:30; main emits the UTC value.On Windows, use the existing libc local-time conversion and its
tm_gmtoff, and link libSceRtc to libc. This extends the offset calculation to RTC's years 1 to 9999, including conversion, local-clock queries and local RFC formatting. Linux keeps its existing native conversion. The existing libc 400-year calendar fallback and its historical daylight-saving limitation are recorded in RTC's technical debt.Microsoft's localtime documentation identifies the CRT range and the failure for negative or oversized timestamps.
Tested
Windows, MinGW GCC 15.2, Release,
BUILD_TESTING=ON; regression reproduced on main46e7cd3e8, rebased onto88107b7de:RTC local offset lost for year 1 in XXX-5:30.7e181fcc3completed every remaining target except recreation of the unrelatedguest_fstatfs_tests.exeoutput, which Windows denies. After rebasing to88107b7de, the explicit libs build and seven runtime/loading checks passed; unrelated executable outputs remain blocked during rebuilds. Avast's log records automatic sandboxing of that test. The local full-build limitation remains; local full-build success is not claimed.Review validation
Ready for maintainer review. Full Linux/Windows CI requires a maintainer's manual dispatch; marking this PR ready does not claim those jobs passed.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T08:41:08Z.
Windows test: head
ae307efe0merged onto currentmaina373241de(clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release,-j2: full build 0 errors; ctest with the filterguest_rtc: guest_rtc passed (1 test(s), 0 failed);python tools/check_conventions.py --base upstream/mainpassed. I did not run the new tests againstmainwithout the change.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T23:25:53Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/debt/libSceRtc.mdL8Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:35:36Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Imported from boykopovar/AnyPS5. Originally posted by QRMOE on 2026-10-15T07:45:28Z.
Understood. I’ll leave this closed and revisit it only with a title ID and a current-main log showing the failure. I’ll hold off on new PRs without a title needing the change while the queue is high.
Pull request closed