Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-52551: Use wcsftime() to implement time.strftime() on Windows
  • Loading branch information
serhiy-storchaka committed Oct 17, 2024
commit 629ff02cd4593b68bf4476bb78b660395aee191e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use :c:func:`!wcsftime` to implement :func:`time.strftime` on Windows.
3 changes: 1 addition & 2 deletions Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,7 @@ checktm(struct tm* buf)
}

#ifdef MS_WINDOWS
/* wcsftime() doesn't format correctly time zones, see issue #10653 */
# undef HAVE_WCSFTIME
# define HAVE_WCSFTIME

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are compiler warnings: 'HAVE_WCSFTIME': macro redefinition [D:\a\cpython\cpython\PCbuild_freeze_module.vcxproj]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I did not find where it was defined in C.

#endif
#define STRFTIME_FORMAT_CODES \
"Commonly used format codes:\n\
Expand Down