View previous topic :: View next topic |
Author |
Message |
Strange_Attractor n00b

Joined: 07 Mar 2011 Posts: 36 Location: Sweden
|
Posted: Fri Apr 10, 2015 3:52 pm Post subject: Timedatectl displays wrong time |
|
|
I have tried
Code: | timedatectl set-timezone Europe/Stockholm | (which is UTC +2h)
/etc/timezone is already a symlink to ../usr/share/zoneinfo/Europe/Stockholm
/etc/localtime contains only the string "Europe/Stockholm"
Output from timedatectl is
Code: |
Local time: fre 2015-04-10 15:50:27 UTC
Universal time: fre 2015-04-10 15:50:27 UTC
RTC time: fre 2015-04-10 15:50:27
Time zone: Europe/Stockholm (UTC, +0000)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
|
shows only time in UTC format. RTC is set to UTC time. How do I fix this? |
|
Back to top |
|
 |
russK l33t


Joined: 27 Jun 2006 Posts: 648
|
Posted: Sat Apr 11, 2015 5:16 am Post subject: |
|
|
Quote: | /etc/timezone is already a symlink to ../usr/share/zoneinfo/Europe/Stockholm
/etc/localtime contains only the string "Europe/Stockholm" |
That sounds backwards. Read the 'man 5 localtime' man page.
I have the file /etc/timezone containing string "America/New_York", and the /etc/localtime is a soft link to ../usr/share/zoneinfo/America/New_York. So, my 'date' command returns time in EDT.
Try swapping the two.
HTH |
|
Back to top |
|
 |
Strange_Attractor n00b

Joined: 07 Mar 2011 Posts: 36 Location: Sweden
|
Posted: Sat Apr 11, 2015 10:37 am Post subject: |
|
|
Thanks! I tried swapping the files, but "date" still shows time in UTC. |
|
Back to top |
|
 |
Strange_Attractor n00b

Joined: 07 Mar 2011 Posts: 36 Location: Sweden
|
Posted: Sat Apr 11, 2015 10:38 am Post subject: |
|
|
BTW, I use KDE. I don't have this problem with Gnome 3 on my laptop. |
|
Back to top |
|
 |
russK l33t


Joined: 27 Jun 2006 Posts: 648
|
Posted: Sat Apr 11, 2015 6:16 pm Post subject: |
|
|
I would not have thought your desktop environment would matter, but you never know these days. I am on gnome 3.14 and there is a Date/Time settings dialog accessible from the settings panel, which allows manipulation of the timezone for the user. I would think one would want the date command working properly outside of the desktop environment before manipulating the timezone inside the desktop environment.
Sorry I don't use kde much.
Another thing to try, which seems a little like a hack, put 'export TZ=Europe/Stockholm' in either /etc/profile or ~/.bashrc. Open a new shell and try 'date' again. |
|
Back to top |
|
 |
Strange_Attractor n00b

Joined: 07 Mar 2011 Posts: 36 Location: Sweden
|
Posted: Sat Apr 11, 2015 8:43 pm Post subject: |
|
|
The only thing that works is setting the timezone to CET. Or alias date='TZ=CET date' in .bashrc. |
|
Back to top |
|
 |
Strange_Attractor n00b

Joined: 07 Mar 2011 Posts: 36 Location: Sweden
|
Posted: Sun Apr 12, 2015 12:59 pm Post subject: |
|
|
Update: Does not work on Gnome 3 either. I'm confused. |
|
Back to top |
|
 |
ferrelas Tux's lil' helper

Joined: 14 Jun 2008 Posts: 107
|
Posted: Thu Apr 16, 2015 2:08 am Post subject: |
|
|
Have you tried switching from UTC to localtime? It's wrong(tm), but it could solve the issue. |
|
Back to top |
|
 |
|