Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Timedatectl displays wrong time
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Strange_Attractor
n00b
n00b


Joined: 07 Mar 2011
Posts: 36
Location: Sweden

PostPosted: Fri Apr 10, 2015 3:52 pm    Post subject: Timedatectl displays wrong time Reply with quote

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



Code:
date
shows only time in UTC format. RTC is set to UTC time. How do I fix this?
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 618

PostPosted: Sat Apr 11, 2015 5:16 am    Post subject: Reply with quote

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
View user's profile Send private message
Strange_Attractor
n00b
n00b


Joined: 07 Mar 2011
Posts: 36
Location: Sweden

PostPosted: Sat Apr 11, 2015 10:37 am    Post subject: Reply with quote

Thanks! I tried swapping the files, but "date" still shows time in UTC.
Back to top
View user's profile Send private message
Strange_Attractor
n00b
n00b


Joined: 07 Mar 2011
Posts: 36
Location: Sweden

PostPosted: Sat Apr 11, 2015 10:38 am    Post subject: Reply with quote

BTW, I use KDE. I don't have this problem with Gnome 3 on my laptop.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 618

PostPosted: Sat Apr 11, 2015 6:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Strange_Attractor
n00b
n00b


Joined: 07 Mar 2011
Posts: 36
Location: Sweden

PostPosted: Sat Apr 11, 2015 8:43 pm    Post subject: Reply with quote

The only thing that works is setting the timezone to CET. Or alias date='TZ=CET date' in .bashrc.
Back to top
View user's profile Send private message
Strange_Attractor
n00b
n00b


Joined: 07 Mar 2011
Posts: 36
Location: Sweden

PostPosted: Sun Apr 12, 2015 12:59 pm    Post subject: Reply with quote

Update: Does not work on Gnome 3 either. I'm confused.
Back to top
View user's profile Send private message
ferrelas
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jun 2008
Posts: 107

PostPosted: Thu Apr 16, 2015 2:08 am    Post subject: Reply with quote

Have you tried switching from UTC to localtime? It's wrong(tm), but it could solve the issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum