Environment Variable for Short Date?

Hi, I am on a Spanish system, but I need US settings for a game. I did add LANG en_US.UTF-8 to Lutris, and it works as expected. However, dates are shown long, i.e., Sunday, December 8th, 2024. This is too long for the game which requires short dates, i.e., Sun, Dec. 8th, 2024 or even just Dec. 8th, 2024.

I tried to add LC_TIME en_US, as apparently this is how it should be displayed by default. However, the date is still long.

So any idea, how to change it?

Cheers and happy Sunday!

Hi,

WINE
WINE games are going to display dates differently, but it does take the system LANG variable. So before running your WINE game, change the language. However, you might need to tweak your WINE registry environment settings for time (use wine regedit, find HKEY_CURRENT_USER\Control Panel\International reg value sShortDate or sLongDate)

Linux
A lot depends on the way the game is requesting the date and if it is obeying installed/available locales.

The command “locale” on its own will display current settings, “locale -a” will list available locales. You’ll see each language has utf8 suffix.

locale -a

To use en_US, add “.utf8” (you can use LC_TIME instead, but LANG is more common)

LANG="en_US.utf8" date

You can tweak the system format, but you should not have to - most Linuxes default to the shortened date form.

Thanks, to translate that to Lutris, I go to Configure - Global Settings - Environment Variables and put LANG in key and en_US.utf8 date into the value field?

Also, I thought it was en_US.UTF-8

As for the game, it is Aurora 4X and it is supposed to use the Windows Settings, that you would set up in the System Settings or via the registry. Changing the format with winereg didn´t work though.

With regards to the capitalisation either should work.

$ LANG=fr_FR.UTF-8 date
  dim. 08 déc. 2024 23:14:40 GMT
$ LANG=en_US.UTF-8 date
  Sun Dec  8 11:16:16 PM GMT 2024
$ LANG=fr_FR.utf8 date
  dim. 08 déc. 2024 23:14:45 GMT
$ LANG=en_US.utf8 date
  Sun Dec  8 11:16:40 PM GMT 2024

I’d try experimenting with stock WINE first (just realised wine-staging hit 10.0~rc1!)
That way you can launch the exe more directly with variables, whether LANG, LC_TIME or others.

export WINEPREFIX=~/path/to/wineprefix
LANG="en_US.utf8" wine $WINEPREFIX/drive_c/application_dir/someapp.exe

Yes, in Lutris any variable in the System Options section is set when you launch a game.

If that doesn’t work, you’re down to whatever Aurora 4X is written in - by the look of the site, it says C#. Then it might be related to whatever .NET (whether full fat 4.8, Mono, or Core 7+) is installed in the prefix.

Hi, thanks for your reply. The forums say, it adheres to the system settings.

Windows users are told, to change the decimal point from , to . (in countries where it is necessary) and to change the long date format, so it does not show the name of the current day but just the date like august 15th 2022 or aug 15th 2023.

This works on a Windows machine, but changing the registry using winereg doesn´t work. So I would like to try it with an environment variable in Lutris.

That’s windows programmers for you :slight_smile:

I tried PowerShell’s get-date to replicate your issue, since PowerShell is as close to C# as I’m going to get. I’m hoping your application uses the same logic!

WINEPREFIX=~/timetest
wine $WINEPREFIX/drive_c/Program\ Files/PowerShell/7-preview/pwsh.exe -c get-date

…the default, I get
Monday, December 9, 2024 1:31:55 PM

If I wine regedit the sLongDate from this:
dddd, MMMM d, yyyy
to this:
ddd, MMM d, yyyy

And then run the same command, I get
Mon, Dec 9, 2024 1:33:15 PM

Afterwards, I found every time I use LANG= in front of the wine >command<, it resets that registry setting.

However, you can set the LANG in the prefix once, update the registry entry, and it persists for subsequent commands.

If something is setting the language every launch you’re probably going to have to use this as part of the startup to format the date into that shorter second form.

WINEPREFIX=~/timetest
wine reg add "HKCU\Control Panel\International" /v sLongDate /t REG_SZ /d "ddd, MMM d, yyyy" /f

Just for clarity, the sequence of commands for a NEW manual prefix: -

mkdir ~/timetest2 && export WINEPREFIX=~/timetest2
wine wineboot
LANG=en_US.utf8 wine reg add "HKCU\Control Panel\International" /v sLongDate /t REG_SZ /d "ddd, MMM d, yyyy" /f 
wine regedit

…you can browse to the sLongDate key in regedit and see the Language and time settings are set.
As I said, as long as nothing else sets LANG - remove any variables you’ve added to Lutris at this point :slight_smile: - it should persist.

I just hope your application uses it properly!

1 Like

Hi, thanks for your reply.
This is what I thought would work. But for some reason it does not… The registry is set properly:

image

I launch the game… and this is what I see:

So something is not working… in Windows it does work… it doesn’t in Wine / Lutris, for whatever reason.

Some more info… running date on my system returns:

[bbuske@BuskeIT-PC ~]$ date
Mon Dec  9 11:31:45 AM -04 2024

So it is showing correctly in Linux… yet it seems to ignore / reset the regedit setting…

I probably just give up…

Maybe my suggestion is a little silly, but did you try with LC_ALL or did that have unpredictable behavior?

LC_TIME=en_US.UTF-8 
LC_ALL=en_US.UTF-8

Also, as a last resort, you can try C since that’s basically meant to be the simplest locale possible, which typically has short dates.

LC_TIME=C

1 Like

It is not working. The application seems to completely ignore the settings in Wine… Something must be different in Windows. I just leave it be for now.