BUG:rocky Linux 9.0 System time display problem

When installing rockylinux9.0, the 24-hour time format is selected, but after entering the system, the time is displayed in the 12 hour format, which is still the case after repeated installation for 3 times.

image

I just downloaded rhel9.0, and the problem of testing still exists. It seems that the problem comes from the upstream.

What locale did you choose for your system? Chances are you are using a locale that has a 12 hour format, for example en_US does by default.

[root@rocky-desktop ian]# localectl 
   System Locale: LANG=en_US.UTF-8
       VC Keymap: us
      X11 Layout: us

[root@rocky-desktop ian]# date
Sat Jul 16 06:43:03 PM CEST 2022

so now I change to en_GB which is usually 24 hour for regional settings:

[root@rocky-desktop ian]# localectl set-locale LC_TIME=en_GB.UTF-8

[root@rocky-desktop ian]# date
Sat Jul 16 06:43:41 PM CEST 2022

problem solved. If you have a graphical environment, you may want to check in the settings there, or just fix it at the console.

It’s not a bug, but the way your regional settings are configured.

The date command uses the default C locale, which prints the date using ‘+%a %b %e %H:%M:%S %Z %Y’’, so the output looks like ‘Thu Jul 9 17:00:00 EDT 2020’. (From google)

I believe when you select the 24-hour format, it is for your graphical applications.

@iwalker
According to the method you proposed, log in again after executing the command, and the problem is indeed solved. Thank you.
image