feat(rtc): implement sceRtcFormatRFC2822 and the RFC 2822/3339 local-time formatters #804
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/804"
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 adriadam10 on 2026-10-06T05:28:02Z.
What
Implements three libSceRtc formatters that
maindid not declare at all (NIDseiuobaF-hK4,AxHBk3eat04,DwuHIlLGW8I):sceRtcFormatRFC2822(buf, utc, minutes):Thu, 29 Feb 2024 14:04:56 +0130(weekday, two-digit day, month name, four-digit year,±HHMM;+0000for 0).sceRtcFormatRFC2822LocalTime(buf, utc)andsceRtcFormatRFC3339LocalTime(buf, utc): the same formatters (the existingsceRtcFormatRFC3339for the latter) with the host's local offset.Reference: shadPS4
rtc.cppis the only body (fpPS4 has them as TODO, SharpProspero has signatures only). Where we differ from it:+015for 65 minutes) and takes the sign from the hours, so -30 comes out as+030. Here it is%02d%02dwith the sign of the whole offset (+0105,-0030), as RFC 2822 §3.3 requires.INVALID_POINTERand offsets outside ±1439 minutes returnINVALID_VALUE, the same contract as the existingsceRtcFormatRFC3339onmain. shadPS4 formats the current time for a null tick and has no range check. A tick that overflows after adding the offset returnsINVALID_VALUE(shadPS4 returns OK and writes nothing).sceRtcConvertUtcToLocalTimeonmain. shadPS4 usessceKernelGettimezone, which gives the current offset.All of this is listed under TechnicalDebt "Unknown function info".
Tested
Linux,
guest_rtc(extended):Mon, 01 Jan 0001) and the max tick (Fri, 31 Dec 9999). The expected strings come from Pythondatetime.TZset to +05:30, -03:00 and UTC.On
mainthe test doesn't link because the exports don't exist. 8 mutants (weekday index, month index, sign, padding, local offset, range check, overflow check, null guard) each make it fail. Full Release build (GCC) plusctest -R 'guest_|rtc': 117/117 pass.merge-treeagainst #782 and #803 (other Rtc PRs of mine) is clean.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T05:28:22Z.
Progress report (
109a328→3515ead)📈 System libraries: 82.32% (+0.02%, +3 implemented functions)
✅ 3 implemented
sceRtcFormatRFC2822sceRtcFormatRFC2822LocalTimesceRtcFormatRFC3339LocalTime