CentOS 6 timezone is BST, but it's an hour behind BST?

2

Running a (fairly) fresh install of CentOS 6.

[jammy@peach]$ date
Fri Jul 13 15:41:30 BST 2012

The actual BST time is exactly one hour ahead of this, 16:41.

Unless I'm missing something about how DST works, shouldn't my server be reporting the correct (i.e UTC+1) time, considering its timezone is set to BST?

Does the server need its clock updated or do I need to change its timezone to something else?

jammypeach

Posted 2012-07-13T15:48:53.387

Reputation: 160

1Try synchronize with an NTP server by running ntpdate. – quantum – 2012-07-13T16:03:25.810

hah just beat me to it :) yeah that's what I ended up doing – jammypeach – 2012-07-13T16:07:13.427

Answers

0

I don't know why this wasn't right to start with, but syncing the clock with an NTP server got it set to the right time.

I had to install a few things though, here's what and how:

[jammy@peach]$ date
Fri Jul 13 16:01:40 BST 2012

[jammy@peach]$ yum install ntp

[jammy@peach]$ sudo ntpdate uk.pool.ntp.org
13 Jul 17:01:50 ntpdate[32274]: step time server 83.231.183.4 offset 3494.293121 sec

[jammy@peach]$ date
Fri Jul 13 17:01:57 BST 2012

Might be worth a cron job I think...

Links:

http://www.pool.ntp.org/en/

http://www.ntp.org/

jammypeach

Posted 2012-07-13T15:48:53.387

Reputation: 160

2

Try this:

# ntpdate uk.pool.ntp.org

should synchronize your server with the network time protocol servers above.

# yum install ntp
# chkconfig ntpd on
# ntpdate pool.ntp.org
# /etc/init.d/ntpd start

If you don't have ntp installed you can try the above commands to install ntp.

# hwclock --systohc

should synchronize date and time for the hardware clock.

l'L'l

Posted 2012-07-13T15:48:53.387

Reputation: 1 840

Perfect! ntpdate uk.pool.ntp.org fixed my problem – George Chalhoub – 2018-06-19T19:01:26.107

I had all that done but the hwclock part, thanks for that – jammypeach – 2012-07-16T08:23:00.217