Skip to content

F2592 locale date time#2677

Open
shewitt-au wants to merge 20 commits intoWerWolv:masterfrom
shewitt-au:F2592-Locale-date-time
Open

F2592 locale date time#2677
shewitt-au wants to merge 20 commits intoWerWolv:masterfrom
shewitt-au:F2592-Locale-date-time

Conversation

@shewitt-au
Copy link
Contributor

@shewitt-au shewitt-au commented Mar 9, 2026

Problem description

Dates and times currently have a fixed format and do not respect the selected language. MinGW’s (Windows) std::locale class is broken and basically useless. This PR implements, along with the libwolv PR linked below, date and time formatting using the Win32 API on Windows and the C runtime library on other OSes.

The motivating feature request can be found here:
Format time based on locale #2592

The corresponding libwolv changes can be found here:
libwolv changes

Implementation description

For the most part, ImHex has been changed to use a new function in libwolv for date and time formatting. A notification was also added to update the Data Inspector when the language is changed. Some changes were made to fix issues in the existing code that make sense even without the broader changes:

  • The time formatting code was using the local time zone instead of GMT.
  • time_t was being treated as unsigned, but it should be signed.
  • When there was a formatting issue with a time_t "Invalid" was displayed. No time_t is invalid. The issue is with our ability to format it. I have changed the message to "Can't format" for now.

@shewitt-au shewitt-au marked this pull request as ready for review March 11, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant