You are not logged in.

#1 2022-06-29 01:34:40

nasedase
Member
Registered: 2022-06-28
Posts: 13

browsers only display 24 hour format and dates in DD MM YYYY

Using KDE on Arch Linux, time and date on the desktop are 12hr and MM DD YYYY, but on any web browser it shows 24 hour format. Not sure if this information is relevant but this is my locale and I've ran local-gen:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Offline

#2 2022-06-29 01:54:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: browsers only display 24 hour format and dates in DD MM YYYY

nasedase wrote:

but on any web browser it shows 24 hour format.

Do you mean on the content of web pages??  This is up to the author of that content.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2022-06-29 02:37:06

nasedase
Member
Registered: 2022-06-28
Posts: 13

Re: browsers only display 24 hour format and dates in DD MM YYYY

Trilby wrote:
nasedase wrote:

but on any web browser it shows 24 hour format.

Do you mean on the content of web pages??  This is up to the author of that content.

not in this case. I use a site that requires time entry. On my other computers it formats to 12hr, on this install of arch it's 24hr and European date format.

Offline

#4 2022-06-29 02:47:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: browsers only display 24 hour format and dates in DD MM YYYY

What site - is this something we can test?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2022-06-29 02:47:44

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: browsers only display 24 hour format and dates in DD MM YYYY

What do `locale` and `locale -a` return? Are you using Plasma?

Last edited by Scimmia (2022-06-29 02:48:49)

Online

#6 2022-06-29 04:02:24

nasedase
Member
Registered: 2022-06-28
Posts: 13

Re: browsers only display 24 hour format and dates in DD MM YYYY

Scimmia wrote:

What do `locale` and `locale -a` return? Are you using Plasma?

locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"

locale -a
C
C.UTF-8
en_US.utf8
POSIX

LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Not a public site to test unfortunately, it's work related. I can test it though.

Offline

#7 2022-06-29 06:18:07

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: browsers only display 24 hour format and dates in DD MM YYYY

"LC_ALL=en_US.UTF-8" isn't supposed to be there … what's the output of "localectl"?
Please enumerate "on any web browser" and whether you're running them through wine or installed them via snap/flatpak and are they the same browser/version as "on my other computers"?
Then check the browsers configuration, they allow to configure the locale (or at least UI language, what very well might have an effect here) - notably intl.regional_prefs.use_os_locales on FF

Offline

#8 2022-06-30 21:12:08

nasedase
Member
Registered: 2022-06-28
Posts: 13

Re: browsers only display 24 hour format and dates in DD MM YYYY

seth wrote:

"LC_ALL=en_US.UTF-8" isn't supposed to be there … what's the output of "localectl"?
Please enumerate "on any web browser" and whether you're running them through wine or installed them via snap/flatpak and are they the same browser/version as "on my other computers"?
Then check the browsers configuration, they allow to configure the locale (or at least UI language, what very well might have an effect here) - notably intl.regional_prefs.use_os_locales on FF

localectl
   System Locale: LANG=en_US.UTF-8
       VC Keymap: us
      X11 Layout: us


I've attached two images, the first from the effected arch install, the second is my other arch install. I've done nothing in settings to change this.

incorrect time

correct time

Offline

#9 2022-06-30 21:53:29

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: browsers only display 24 hour format and dates in DD MM YYYY

Again, are you using Plasma?

Edit: Re-reading, it appears you are. Delete ~/.config/plasma-localerc.

Last edited by Scimmia (2022-06-30 21:54:28)

Online

#10 2022-07-01 13:48:36

nasedase
Member
Registered: 2022-06-28
Posts: 13

Re: browsers only display 24 hour format and dates in DD MM YYYY

Scimmia wrote:

Again, are you using Plasma?

Edit: Re-reading, it appears you are. Delete ~/.config/plasma-localerc.

Done. Ran locale-gen, and after reboot it regenerated with this:
[Formats]
LANG=en_US.UTF-8

unfortunately the website is still in 24 hour format.

Offline

#11 2022-07-01 14:30:04

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: browsers only display 24 hour format and dates in DD MM YYYY

seth wrote:

Please enumerate "on any web browser" and whether you're running them through wine or installed them via snap/flatpak and are they the same browser/version as "on my other computers"?
Then check the browsers configuration, they allow to configure the locale (or at least UI language, what very well might have an effect here) - notably intl.regional_prefs.use_os_locales on FF

Offline

#12 2022-07-01 14:37:59

nasedase
Member
Registered: 2022-06-28
Posts: 13

Re: browsers only display 24 hour format and dates in DD MM YYYY

seth wrote:
seth wrote:

Please enumerate "on any web browser" and whether you're running them through wine or installed them via snap/flatpak and are they the same browser/version as "on my other computers"?
Then check the browsers configuration, they allow to configure the locale (or at least UI language, what very well might have an effect here) - notably intl.regional_prefs.use_os_locales on FF

I'm using Chromium from Pacman's "extra" repository, and Microsoft Edge from Aur. Both have this issue on this computer which leads me to believe it's a setting within the computer. I couldn't find locale settings for either browser. Also the other computer that has 12hr format is arch linux using both edge and chromium. I'm not using wine, snap or flatpaks on either desktop. I'm using the latest versions from Aur and Pacman.

Offline

#13 2022-07-01 14:46:40

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: browsers only display 24 hour format and dates in DD MM YYYY

chrome://settings/languages ?

Offline

#14 2022-07-01 14:47:31

JoeyCorleone
Member
Registered: 2022-01-22
Posts: 88

Re: browsers only display 24 hour format and dates in DD MM YYYY

Close all Chromium instances and run the following command:

LC_ALL=en_US.UTF-8 chromium https://greenwichmeantime.com/current-time/

Should show the time in 12h format.

Now close all Chromium instances again before running the next command:

LC_ALL=en_DE.utf8 chromium https://greenwichmeantime.com/current-time/

Should show the time in 24h format.

Can you confirm?

Last edited by JoeyCorleone (2022-07-01 14:47:45)

Offline

#15 2022-07-01 15:41:05

nasedase
Member
Registered: 2022-06-28
Posts: 13

Re: browsers only display 24 hour format and dates in DD MM YYYY

seth wrote:

chrome://settings/languages ?

the preffered setting was UK English, changed it to American, didn't resolve the issue unfortunately.

Offline

#16 2022-07-01 15:41:52

nasedase
Member
Registered: 2022-06-28
Posts: 13

Re: browsers only display 24 hour format and dates in DD MM YYYY

JoeyCorleone wrote:

Close all Chromium instances and run the following command:

LC_ALL=en_US.UTF-8 chromium https://greenwichmeantime.com/current-time/

Should show the time in 12h format.

Now close all Chromium instances again before running the next command:

LC_ALL=en_DE.utf8 chromium https://greenwichmeantime.com/current-time/

Should show the time in 24h format.

Can you confirm?

Yes that did change the website to display 12hr format. When I close and reopen without the command it goes back to 24 hr.

Offline

#17 2022-07-01 15:53:23

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: browsers only display 24 hour format and dates in DD MM YYYY

#1 & #6 state that you *had* exported LC_ALL=en_US.UTF-8 ?

close and reopen without the command

How exactly?

for PID in $(pidof chromium); do tr '\0' '\n' < /proc/$PID/environ | grep -E '(LANG|LC)'; done

Offline

#18 2022-07-01 16:10:59

JoeyCorleone
Member
Registered: 2022-01-22
Posts: 88

Re: browsers only display 24 hour format and dates in DD MM YYYY

Close all Chromium instances and run the following command:

LC_ALL=en_US.UTF-8 chromium

Now open your private website. Does it also show the expected 12h format?

If yes, post the output of the following commands:

locale
locale -a
cat /etc/locale.conf
cat $XDG_CONFIG_HOME/locale.conf
cat ~/.config/locale.conf

Offline

#19 2022-07-01 16:11:11

nasedase
Member
Registered: 2022-06-28
Posts: 13

Re: browsers only display 24 hour format and dates in DD MM YYYY

seth wrote:

#1 & #6 state that you *had* exported LC_ALL=en_US.UTF-8 ?

close and reopen without the command

How exactly?

for PID in $(pidof chromium); do tr '\0' '\n' < /proc/$PID/environ | grep -E '(LANG|LC)'; done

I put "export LC_ALL=en_US.UTF-8" in .bashrc

I removed it after it was stated in this thread that it isn't needed.

close and reopen without the command

specifically, I run LC_ALL=en_US.UTF-8 microsoft-edge-stable https://greenwichmeantime.com/current-time/ in the terminal, go the the website i presented previously and it's changed to 12hr format. After closing I open microsoft-edge-stable normally and it's reverted back to 24hr.

Offline

#20 2022-07-01 16:20:59

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: browsers only display 24 hour format and dates in DD MM YYYY

seth wrote:
for PID in $(pidof chromium); do tr '\0' '\n' < /proc/$PID/environ | grep -E '(LANG|LC)'; done

I open microsoft-edge-stable normally

seth wrote:

How exactly?

LC_ALL isn't needed, it's a debug tool (more or less) but since you claimed to have had it but it didn't have any impact, but does when exported directly, it stands to reason that your locale doesn't apply to the specific process you "open normally".

Offline

#21 2022-07-01 16:47:40

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: browsers only display 24 hour format and dates in DD MM YYYY

nasedase wrote:

I put "export LC_ALL=en_US.UTF-8" in .bashrc

I removed it after it was stated in this thread that it isn't needed.

And have you (fully) logged this user out and back in again (or rebooted) since you removed this from your bashrc?  If not, do so now ... and magically all your problems will be solved.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#22 2022-07-01 17:55:31

nasedase
Member
Registered: 2022-06-28
Posts: 13

Re: browsers only display 24 hour format and dates in DD MM YYYY

Trilby wrote:
nasedase wrote:

I put "export LC_ALL=en_US.UTF-8" in .bashrc

I removed it after it was stated in this thread that it isn't needed.

And have you (fully) logged this user out and back in again (or rebooted) since you removed this from your bashrc?  If not, do so now ... and magically all your problems will be solved.

Did that, rebooted, cleared cookies, still on the 24hr clock.

Offline

#23 2022-07-01 18:08:01

nasedase
Member
Registered: 2022-06-28
Posts: 13

Re: browsers only display 24 hour format and dates in DD MM YYYY

Trilby wrote:
nasedase wrote:

I put "export LC_ALL=en_US.UTF-8" in .bashrc

I removed it after it was stated in this thread that it isn't needed.

And have you (fully) logged this user out and back in again (or rebooted) since you removed this from your bashrc?  If not, do so now ... and magically all your problems will be solved.

I created a new user and it has the 12 hour clock format, so it has to be something with the profile.

Offline

#24 2022-07-01 18:08:35

JoeyCorleone
Member
Registered: 2022-01-22
Posts: 88

Re: browsers only display 24 hour format and dates in DD MM YYYY

Have you seen my last post? My guess is that somewhere ($XDG_CONFIG_HOME/locale.conf, ~/.config/locale.conf, ~/.profile, ~/.bashrc, /etc/profile, ...) you accidentally set one of the LC or LANG variables which overrides the system locale.

Offline

#25 2022-07-01 18:26:43

nasedase
Member
Registered: 2022-06-28
Posts: 13

Re: browsers only display 24 hour format and dates in DD MM YYYY

JoeyCorleone wrote:

Have you seen my last post? My guess is that somewhere ($XDG_CONFIG_HOME/locale.conf, ~/.config/locale.conf, ~/.profile, ~/.bashrc, /etc/profile, ...) you accidentally set one of the LC or LANG variables which overrides the system locale.

we've done something right, because chromium is 12hr now, even when i open without the command. When I run the command and replace "chromium" with microsoft-edge-stable it's still a 24 hour format. Unfortunately this is my primary browser for the website. Here are the results of the requested commands:

locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_US.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8

locale -a
C
C.UTF-8
en_US.utf8
POSIX

LC_ALL=


cat /etc/locale.conf
LANG=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_TIME=en_US.UTF-8


cat $XDG_CONFIG_HOME/locale.conf
cat: /locale.conf: No such file or directory

cat ~/.config/locale.conf
cat: /home/REDACTED/.config/locale.conf: No such file or directory

Offline

Board footer

Powered by FluxBB