Hi, everyone.
I am trying to figure out how to ask Gnome for the correct string that is used for formatting a date according to the user’s settings. I’m working on an Electron application, so I don’t get to just use Gnome widgets, but I am able to call C APIs to get the relevant information.
So, as part of my research, I set an FC39, Gnome 45 system to still use English as my language, but Russian as my date format. I wrote an application which queries relevant values from get_langinfo
. And then I took a screenshot of a bunch of these things all side-by-side:
The gist of the screenshot is this. According to my application, get_langinfo(D_FMT)
returns “%m/%d/%y”. At the same time, the Gnome Settings Region Format panel shows that today’s date should be rendered as 17.11.2023
, which is the %d.%m.%y
format. Further, Gnome is showing the current day, month in Russion, but it appears that it’s the same format as a US date.
So, the crux of the question.
I’m wanting to display a date, or display a date entry field, in the correct format that the user has set on their system. How do I ask the system what that format should be, without delegating the formatting to Gnome widgets?