You are not logged in.

#1 2013-07-29 23:36:40

NorthAntrim
Member
Registered: 2012-09-09
Posts: 46

[SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

I installed Arch today (not for the first time) and noticed that the time appears to be wrong.

Here's the output from timedatectl status:

      Local time: Tue 2013-07-30 01:33:13 BST
  Universal time: Tue 2013-07-30 00:33:13 UTC
        Timezone: Europe/Belfast (BST, +0100)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2013-03-31 00:59:59 GMT
                  Sun 2013-03-31 02:00:00 BST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2013-10-27 01:59:59 BST
                  Sun 2013-10-27 01:00:00 GMT

As you can see, the timezone is set to Europe/Belfast and DST is active, however the time is an hour later than it should be.

The current localtime in Belfast should be what universal time is. Here is the current time in Belfast.

Have I overlooked something, or is there something wrong with the Europe/Belfast timezone (I've used it in previous Arch installs with the correct time)? I know the time can be set manually, however I'd prefer to use the timezone so that the time is more accurate.

Last edited by NorthAntrim (2013-07-30 00:45:20)

Offline

#2 2013-07-29 23:43:50

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

The page you linked says

Current time zone offset:    UTC/GMT +1 hour

This appears to say that your local time should be UTC+one hour. Are you saying that the time displayed on your system is UTC+2 hours, or that it is UTC+1 hour and that this wrong? From the output you gave (UTC is the correct time in your timezone) it appears that your hardware clock is not in fact set to UTC, but it is set to your local time.

What is the output of

sudo hwclock --debug

And when you run this command, what is your correct local time?

Compare what your hardware clock thinks is UTC to this: http://www.worldtimeserver.com/current_time_in_UTC.aspx

Last edited by 2ManyDogs (2013-07-29 23:50:39)

Offline

#3 2013-07-29 23:50:44

NorthAntrim
Member
Registered: 2012-09-09
Posts: 46

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

2ManyDogs wrote:

The page you linked says

Current time zone offset:    UTC/GMT +1 hour

This seems to say that your local time should be UTC+one hour. Are you saying that the time displayed on your system is UTC+2 hours, or that it is UTC+1 hour and that this wrong?

What is the output of

sudo hwclock --debug

Thanks for the reply.

The local time according to Arch is 01:48, however the local time is actually 00:48, and UTC according to Google is 23:48 (at the time of writing of course) so it's UTC+2 hours.

Here's the output from sudo hwclock --debug:

hwclock from util-linux 2.23.1
Using /dev interface to clock.
Last drift adjustment done at 1375127579 seconds after 1969
Last calibration done at 1375127579 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2013/07/30 00:47:32
Hw clock time : 2013/07/30 00:47:32 = 1375145252 seconds since 1969
Tue 30 Jul 2013 01:47:32 BST  -0.531893 seconds

I'm almost certain I set the hardware clock to use UTC, usually I do.

Thanks again.

Last edited by NorthAntrim (2013-07-29 23:52:58)

Offline

#4 2013-07-29 23:52:32

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

NorthAntrim wrote:

Time read from Hardware Clock: 2013/07/30 00:47:32

Correct UTC time (from http://www.worldtimeserver.com/current_time_in_UTC.aspx is (approximately) 23:48. Your hardware clock is wrong.

You can correct this manually, or if you are using ntpd, try

sudo ntpd -qg

Last edited by 2ManyDogs (2013-07-29 23:55:12)

Offline

#5 2013-07-29 23:54:38

NorthAntrim
Member
Registered: 2012-09-09
Posts: 46

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

2ManyDogs wrote:
NorthAntrim wrote:

Time read from Hardware Clock: 2013/07/30 00:47:32

Correct UTC time (from http://www.worldtimeserver.com/current_time_in_UTC.aspx is (approximately) 23:48. Your hardware clock is wrong.

Thanks. I ran

hwclock --systohc --utc

again and

timedatectl set-local-rtc 0

, however the time hasn't changed (didn't reboot). Any idea what I could do to correct this/why it's wrong?

Last edited by NorthAntrim (2013-07-29 23:55:32)

Offline

#6 2013-07-29 23:55:46

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

2ManyDogs wrote:

You can correct this manually, or if you are using ntpd, try

sudo ntpd -qg

To correct it manually, use

# timedatectl set-time "2012-10-30 18:17:16"

where the string in quotes is your correct local time.

Last edited by 2ManyDogs (2013-07-29 23:57:35)

Offline

#7 2013-07-29 23:59:35

NorthAntrim
Member
Registered: 2012-09-09
Posts: 46

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

2ManyDogs wrote:
2ManyDogs wrote:

You can correct this manually, or if you are using ntpd, try

sudo ntpd -qg

To correct it manually, use

# timedatectl set-time "2012-10-30 18:17:16"

where the string in quotes is your correct local time.

Whoops, missed your edit.

Anyway, installed NTP and ran the command. The system time is now correct, however the hardware clock is still an hour ahead. I take it's fine to leave that since it's still counting time correctly, just an hour ahead?

Offline

#8 2013-07-30 00:01:14

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

NorthAntrim wrote:

Anyway, installed NTP and ran the command. The system time is now correct, however the hardware clock is still an hour ahead. I take it's fine to leave that since it's still counting time correctly, just an hour ahead?

Please post the output of

sudo hwclock --debug

and also tell me what is the correct local time when you ran the command.

Offline

#9 2013-07-30 00:03:09

NorthAntrim
Member
Registered: 2012-09-09
Posts: 46

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

2ManyDogs wrote:
NorthAntrim wrote:

Anyway, installed NTP and ran the command. The system time is now correct, however the hardware clock is still an hour ahead. I take it's fine to leave that since it's still counting time correctly, just an hour ahead?

Please post the output of

sudo hwclock --debug

and also tell me what is the correct local time when you ran the command.

hwclock from util-linux 2.23.1
Using /dev interface to clock.
Last drift adjustment done at 1375145627 seconds after 1969
Last calibration done at 1375145627 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2013/07/30 01:02:12
Hw clock time : 2013/07/30 01:02:12 = 1375146132 seconds since 1969
Tue 30 Jul 2013 02:02:12 BST  -0.531899 seconds

The correct local time is currently 1:02, so the hardware clock is one hour ahead.

Offline

#10 2013-07-30 00:08:51

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

This is still not right. Your hardware clock should be set to UTC (not UTC +1). What is the output of

timedatectl status
ls -l /etc/localtime

Offline

#11 2013-07-30 00:13:58

NorthAntrim
Member
Registered: 2012-09-09
Posts: 46

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

2ManyDogs wrote:

This is still not right. Your hardware clock should be set to UTC (not UTC +1). What is the output of

timedatectl status
ls -l /etc/localtime

Here's the output from a number of commands ran consecutively for comparison:

date (which gives the correct local time since running ntpd -qg):

Tue 30 Jul 01:12:18 BST 2013

hwclock --debug:

hwclock from util-linux 2.23.1
Using /dev interface to clock.
Last drift adjustment done at 1375145627 seconds after 1969
Last calibration done at 1375145627 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2013/07/30 01:12:19
Hw clock time : 2013/07/30 01:12:19 = 1375146739 seconds since 1969
Tue 30 Jul 2013 02:12:19 BST  -0.703819 seconds

timedatectl status:

      Local time: Tue 2013-07-30 01:12:19 BST
  Universal time: Tue 2013-07-30 00:12:19 UTC
        Timezone: Europe/Belfast (BST, +0100)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2013-03-31 00:59:59 GMT
                  Sun 2013-03-31 02:00:00 BST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2013-10-27 01:59:59 BST
                  Sun 2013-10-27 01:00:00 GMT

and, finally:

lrwxrwxrwx 1 root root 34 Jul 29 20:52 /etc/localtime -> /usr/share/zoneinfo/Europe/Belfast

Thanks.

Last edited by NorthAntrim (2013-07-30 00:15:49)

Offline

#12 2013-07-30 00:19:17

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

OK that's just weird. smile timedatectl status says UTC is 00:12, but hwclock --debug says the hwclock is 01:12. And date is correct. This may be the result of some of the "hwclock --systohc" commands you ran earlier. At this point it might be time for a reboot to see if everything continues to work normally.

Offline

#13 2013-07-30 00:27:08

NorthAntrim
Member
Registered: 2012-09-09
Posts: 46

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

2ManyDogs wrote:

OK that's just weird. smile timedatectl status says UTC is 00:12, but hwclock --debug says the hwclock is 01:12. And date is correct. This may be the result of some of the "hwclock --systohc" commands you ran earlier. At this point it might be time for a reboot to see if everything continues to work normally.

Well, I restarted and the time went back to what it was (two hours ahead of what UTC should be.

[north@arctic ~]$ date && sudo hwclock --debug && timedatectl status && ls -l /etc/localtime
Tue 30 Jul 02:26:27 BST 2013
[sudo] password for north: 
hwclock from util-linux 2.23.1
Using /dev interface to clock.
Last drift adjustment done at 1375145627 seconds after 1969
Last calibration done at 1375145627 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2013/07/30 01:26:34
Hw clock time : 2013/07/30 01:26:34 = 1375147594 seconds since 1969
Tue 30 Jul 2013 02:26:34 BST  -0.875549 seconds
      Local time: Tue 2013-07-30 02:26:33 BST
  Universal time: Tue 2013-07-30 01:26:33 UTC
        Timezone: Europe/Belfast (BST, +0100)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2013-03-31 00:59:59 GMT
                  Sun 2013-03-31 02:00:00 BST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2013-10-27 01:59:59 BST
                  Sun 2013-10-27 01:00:00 GMT
lrwxrwxrwx 1 root root 34 Jul 29 20:52 /etc/localtime -> /usr/share/zoneinfo/Europe/Belfast

I'll run

systemctl enable ntpd

and reboot.

edit: that didn't work.

Last edited by NorthAntrim (2013-07-30 00:30:04)

Offline

#14 2013-07-30 00:31:50

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

ntpd will only make small corrections without the -g argument. please try

sudo ntpd -qg

and then look at the output of timedatectl status and date again.

(edit) if this does not work, you may need to set the hardware clock manually.

Last edited by 2ManyDogs (2013-07-30 00:34:43)

Offline

#15 2013-07-30 00:41:41

NorthAntrim
Member
Registered: 2012-09-09
Posts: 46

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

2ManyDogs wrote:

ntpd will only make small corrections without the -g argument. please try

sudo ntpd -qg

and then look at the output of timedatectl status and date again.

(edit) if this does not work, you may need to set the hardware clock manually.

Just done that again.

[north@arctic ~]$ date && sudo hwclock --debug && timedatectl status && ls -l /etc/localtime | tee > date
Tue 30 Jul 01:40:48 BST 2013
hwclock from util-linux 2.23.1
Using /dev interface to clock.
Last drift adjustment done at 1375145627 seconds after 1969
Last calibration done at 1375145627 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2013/07/30 00:40:49
Hw clock time : 2013/07/30 00:40:49 = 1375144849 seconds since 1969
Tue 30 Jul 2013 01:40:49 BST  -0.031880 seconds
      Local time: Tue 2013-07-30 01:40:49 BST
  Universal time: Tue 2013-07-30 00:40:49 UTC
        Timezone: Europe/Belfast (BST, +0100)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2013-03-31 00:59:59 GMT
                  Sun 2013-03-31 02:00:00 BST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2013-10-27 01:59:59 BST
                  Sun 2013-10-27 01:00:00 GMT

Now sudo hwclock --debug gives the right time too. I'll reboot and see if that's it all fixed.

edit: rebooted. I got a boot message saying that the last changes on the hard drive were in the future, so that confirmed it before I even got to a console smile

[north@arctic ~]$ date && sudo hwclock --debug && timedatectl status && ls -l /etc/localtime | tee > date
Tue 30 Jul 01:43:06 BST 2013
[sudo] password for north: 
hwclock from util-linux 2.23.1
Using /dev interface to clock.
Last drift adjustment done at 1375145627 seconds after 1969
Last calibration done at 1375145627 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2013/07/30 00:43:12
Hw clock time : 2013/07/30 00:43:12 = 1375144992 seconds since 1969
Tue 30 Jul 2013 01:43:12 BST  -0.578775 seconds
      Local time: Tue 2013-07-30 01:43:12 BST
  Universal time: Tue 2013-07-30 00:43:12 UTC
        Timezone: Europe/Belfast (BST, +0100)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2013-03-31 00:59:59 GMT
                  Sun 2013-03-31 02:00:00 BST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2013-10-27 01:59:59 BST
                  Sun 2013-10-27 01:00:00 GMT

Thanks for your help!

Last edited by NorthAntrim (2013-07-30 00:44:46)

Offline

#16 2013-07-30 00:45:52

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,646

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

You're welcome!

Offline

#17 2013-07-30 03:18:27

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,268

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

What are the contents of /var/lib/ntp/ntp.drift
(it should be on the order of 10 or 20.  It should not be on the order 3600000000)

If it is a really big number, delete the file.


Edit:  Never mind, somehow I missed the last couple posts hmm

Last edited by ewaller (2013-07-30 03:19:26)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#18 2015-06-24 20:02:41

nmhaker
Member
Registered: 2015-06-24
Posts: 1

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

Guys i found a quick way of fixing time updating. If you had like me, when you run

timedatectl

, option ,,NTP enabled'' set to NO then just turn it on like this

 timedatectl set-ntp true 

and it will automatically update to your configured time zone.

Last edited by nmhaker (2015-06-24 20:04:23)

Offline

#19 2015-06-24 20:41:32

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Timezone set correct, yet time wrong (Europe/Belfast)

Don't necrobump solved threads just to include information in the man page.
https://wiki.archlinux.org/index.php/Fo … bumping.22


Closing


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB