fix(libc): preserve guest time zones in Windows strftime #2665
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2665"
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 ArjenS-LA on 2026-10-10T10:25:21Z.
What
On Windows, formatting a guest UTC timestamp with
%z %Zuses the host timezone: withTZ=PST8PDT,gmtime_sfollowed bystrftimeproduces-0800 PSTinstead of+0000 UTC. WithTZ=JST-9, it produces+0900 JST.Format these two specifiers from
GuestTm::tm_gmtoffandtm_zonebefore delegating the remaining format to the Windows CRT. Preserve literal percent signs, existing Windows#modifiers, unknown-zone handling and buffer limits. Both guest exports share the fix; the Linux implementation is unchanged.This follows the timezone-field handling in FreeBSD strftime. Microsoft documents the CRT's use of global timezone state for these specifiers. It addresses a formatting gap remaining after #1606.
Checked 154 open PRs, their changed files, and the related discussions. No competing implementation found. #545 touches the same file but adds unrelated
ctime_sandasctime_sfunctions.Tested
Time.cppand passes with this fix. The original UTC/Pacific/Japan reproduction now produces+0000 UTCin all three host timezones.guest_time_conversion,guest_process_time,guest_process_time_counterandguest_cpu_time_clocks: 4/4 passed.-std=c++20 -O2 -Wall -Wextra -Werror -pthread; passed.a29ef592; both changed files are byte-for-byte identical to tested commit9093f1c4. The full build and runtime runs above preceded this rebase and were not repeated for the unrelated upstream changes. Conventions and diff checks pass after the rebase.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T10:25:54Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Pull request closed