Usermin Date / Locale problem

Mine is the same, even if that worked it would mean changing each user.
Webmin is also the same as yours.

I have checked anything that I can think of, it appears to be a simple programming oversight and I was hoping staff might investigate.

Looks like I best start manually changing each user. Yay!

I can’t ever remember changing the format. Just as a test I created a test user and logged into usermin and dates fine its using the aussie format for date. Not sure why you system would be different, maybe someone on @staff might know.

Using this page you can change it for each user:

And globally for all users, it can be changed in Webmin ⇾ Usermin Configuration: Usermin Module Configuration / Read Mail / Default user preferences page:

I hope you can fine it! :slight_smile:

1 Like

Thanks Ilia, Usermin and Webmin are already set that way, but still it displays as MM/DD/YY

The only fix I have found is per user, Login to webmail /Usermin / Usermin / Change Language / set Locale to Manual, then select English (Australia).

Messy for sure.

Per Domain in Virtualmin, Administration Options / Switch to Server’s Admin / Virtual Server Details / Webmin Modules / Change Language and Theme / set Locale to Manual and then select English (Australia)

Still messy, but then also works for new users in that domain. Previously created users don’t appear to be affected, but I have done so many tests I am getting a bit confuddled!

Eitherway, if Usermin could just read the Locale from the server OS - which it may be doing on eg Centos 7 that Stefan uses, it would save a lot of messing about for me, and probably other people if it is an RHEL9 issue.

Could it be that I need to make a change at the OS level?

Agreed, ideally we need to centralize that. And I already tried to do that by putting this all under single Change Language and Theme page to control for a user and to Webmin (Usermin) Configuration: Language and Locale page to set it globally for all users. This isn’t that bad.

But I almost completely forgotten that mail has its own date format options for some reason … Probably @Jamie could explain the reason behind it better, and/or remove those completely to rely only on whatever is defined on Webmin side (or Usermin side).

Could it be that I need to make a change at the OS level?

Not sure what you mean exactly … but the main obstacle is that we have two separate date formats (technically).

The old one is when the date generated on the server side, in the server executed scripts, which never reach/output to UI. In this case, it’s controlled by Server generated date format option in Locale configuration / Manual … the old location for this date control feature was Webmin (Usermin) Configuration: User Interface page, i.e. raw dateformat option. This old feature is not very flexible in providing locale based formatted date/time.

The new one, that happens on the theme side, which only receives the timestamp from the server, and process it in UI according to finesse user preferences. It’s much more flexible and powerful.

The best solution would be is to pre-process date/time solely on the server side. But that would require a lot of work (on Perl side) to support different formats and locales. This is not trivial. Actually, it’s like a separate project on its own.

I am trying to work out why Stefan doesn’t have this issue with Centos 7, so I spun up a clean minimal C7 server and installed Vmin - same problem!

When installing C7 (and any RHEL etc) I always make a point of selecting English (Australia) and then setting the timezone to my city in the install process.

Prior and after VMin install and Wizard, localectl status shows:
System Locale: LANG=en_AU.UTF-8
VC Keymap: us
X11 Layout: us

Then both Webmin and Usermin are set to use DD/MM/YYY but they then display in US format.
Webmin status screen, Recent Logins - MM/DD/YYY - so it’s not just mail.

It appears that Webmin and Vmin are ignoring all the settings, the only way to deal with it is by changing Language and Themes by setting Locale to Manual and then selecting English (Australia)

I have now tried with Centos 7 and RHEL 8 & 9, so it’s not an OS version issue.

Stefan, any thoughts why your C7 works and my fresh new C7 doesn’t?

Ilia, can you make the xMin family read the locale and not just the language, and why do the programs ignore being set to use DD/MM/YYY?

@Ilia the date formatting is done in the theme using some client-side Javascript, right?

Not really, I can’t remember doing anything special.

Steve

looking at this the dates appear inconsistent across the whole project
quick example :

hit view logs and you get

I have set my locale to english (appears to be en_US.UTF-8) but I would prefer it to be en_GB.UTF-8

I have experimented with changing locale on the OS, makes no difference to Web/Virtmin.

Well, yes but not all. I explained the problem in details it on the comment above.

I would personally loved to remove all extra code, and solely rely on localectl output and build human readable dates/time on the server side.

As writing this, and looking at the code I remembered that we already do/have something familiar to this (i.e. respect/pass browser defined language/locale to process dates/time). There is an option called acceptlang which is controlled in UI on Webmin ⇾ Webmin Configuration: Language and Locale page with Use language specified by browser? option. So, if you set it to Yes and your browser language is set to English (Australia) (or whatever) then the whole UI will use that language and display dates accordingly too.

I wouldn’t mind dropping completely date/time processing on UI side and use DateTime::Locale instead. @Jamie, it would require rework on Webmin side – how do you feel about that?

I tried this in Firefox, closest option was English GB which fixed the Wemin System Information, Recent Logins, but didn’t appear to change anything in Virtualmin.

By “anything”, which pages are you implying?

Looking to see if I have a snapshot of a test server from before I started fiddling with date format, but that already had some users and email.
I found one without users, but A Usermin login to the server account, then Account Information still shows Time on system as 01/27/2023

Webmin Recent Logins however has changed to DD/MM/YYY

More soon if I find a better snapshot.

OK, found one. Usermin edit user, select user, Password last changed on 05/01/2023. Correct
Login to Usermin. Account information = 01/27/2023. Correct.
Inbox, list of emails still showing as 12/15/2022. Wrong.
If I then view those emails, it shows Date as 15/12/22. Correct.
I just sent a new email, but will need to wait for 24 hours for it to stop showing in the Sent List as just 1:34pm

If this is just a problem for old emails, I can just do the manual locale fix for those users, as long as I don’t have problems moving forward. However, will that mean that I then have to instruct all the users to change browser settings?

Will there be any impact on emails handled by mail clients, so POP3,SMTP, IMAP?

I just created a new Rocky 9 OS. Installed VM and I still have no issues with dates in Usermin.

Send and receive a couple, wait for next year and then check the Inbox List.
First 24 hours, it just shows the time of the email, until Dec 31 it shows the date as eg 26 Jan, but from Jan 1 mails from the previous year show as MM/DD/YYYY

I am noticing it as we just rolled over into a new year. Plus I am importing email from an old mail server and most of that stuff is last year also.

Perhaps you could try importing some mail from last year, or even do some emails then set the server system date to 2024 and have a look.

can you screenshot what you mean.