0

I've been having a number of problems with locale settings and the JVM recently. But this is bigger than that now. I did a Yum update today, full update of everything. It hadn't been done in some time.
Everything is working well, except the system locale settings seem to have been reverted to UTC time. I used localectl set-locale to modify the locale, and rebooted the server.
When I run localectl status I get the following:

System Locale: LANG=en_GB.UTF-8
                  LC_NUMERIC=sv_SE.UTF-8
                  LC_TIME=sv_SE.UTF-8
                  LC_MONETARY=sv_SE.UTF-8
                  LC_PAPER=sv_SE.UTF-8
                  LC_MEASUREMENT=sv_SE.UTF-8
       VC Keymap: us
      X11 Layout: us

I didn't set VC Keymap: us or x11 Layout: us they just appeared like that. But the rest of the settings are as I expected them to be.
My major issue however, is the time; the setting LC_TIME=sv_SE.UTF-8 appears to have no affect on the system time, meaning all my services clocks are off by two hours, reporting UTC time instead of CEST time. This is causing problems in services that are time sensitive.
I'm not really bothered about the rest of the settings, and as best I can tell they seem to be correct anyway, but I really need system time to be correct.
When I run date I get the following:

tis sep 20 12:44:38 UTC 2016

The text is in Swedish as it should be, but the time is UTC instead of CEST.
How can I fix this?

mal
  • 137
  • 6

1 Answers1

3

Although both timezone and locale are usually determined mostly by where you are located, timezone is NOT part of locale. It uses a different env var, TZ -- check if and to what that is set. If not set, the system default (for CentOS) is the file /etc/localtime which should be copied from whichever /usr/share/zoneinfo/** file is desired, in your case presumably Europe/Stockholm.

dave_thompson_085
  • 3,100
  • 1
  • 15
  • 14
  • Many thanks! I actually fixed it with `sudo timedatectl set-timezone Europe/Stockholm` about five minutes before I read your email. This information is very useful, thanks. – mal Sep 21 '16 at 06:02