Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Here in the UK we are UTC+1. I set the time using 'date'. However it keeps resetting back to standard UTC, I'm guessing via a NTP time server.

I've tried setting the timezone with tzselect but it does not change the time, it remains at UTC instead of local time.

Therefore TZ='Europe/London' will be used.
Local time is now:  Thu Jun 25 10:57:48 BST 2009.
Universal Time is now:  Thu Jun 25 09:57:48 UTC 2009.

The above output is correct but the time does not actually get changed.

I either need to disable auto updating of time or ideally setting the timezone correctly.

share|improve this question
    
I have tried setting UTC=no in /etc/default/rcS. This has had no effect (do I need to reboot something)? –  Kris Jun 25 '09 at 10:06
    
UTC=no only governs how the RTC on your mobo should be interpreted, the OS maintains time separately and mostly just utilises the RTC to preserve time between reboot/poweroff. –  Kjetil Joergensen Jun 25 '09 at 11:13

7 Answers 7

up vote 19 down vote accepted

You can also do :

dpkg-reconfigure tzdata

It will then allow you to choose your timezone.

share|improve this answer

I'm not 100% on this, but it's an idea.

I know that on RHEL/CentOS, the time zone is set under /etc as a symlink.

For example, mine is

localtime -> /usr/share/zoneinfo/America/Los_Angeles

Can you confirm that your link is Europe/London? If not, try deleting the localtime symlink and creating one.

share|improve this answer
    
This is exactly what tzselect does. So you should not (need to) do it manually. –  sleske Jun 25 '09 at 10:16
  1. apt-get install ntpdate
  2. ntpdate pool.ntp.org

This will work. i have done this on my server, have a try.

cyclotron:~# ntpdate pool.ntp.org 25 Jun 15:45:05 ntpdate[18445]: step time server 120.88.47.10 offset 485.998764 sec

share|improve this answer

Possibly not an issue in this instance, but I have seen problems when using named timezones before. I'd suggest trying with the GMT offset instead. (Which in your case is obviously just GMT)

share|improve this answer
1  
Sorry, I don't have an answer to the original question (sounds like you are doing the right thing to me), but unfortunately, in general, this suggestion won't work as you expect, because selecting a specific offset won't adjust for daylight savings time accordingly. I use Europe/London (along with NTP) and get GMT or BST at the correct times of year (many folks don't realise the UK is on GMT only during winter-time). –  Andrew Ferrier Jun 26 '09 at 12:35

In Kubuntu, you set the timezone during installation, and then you can change the timezone using System Settings -> Date & Time and then selecting a time zone. However, each upgrade of tzdata (from apt-get upgrade or from automatic package upgrade) seems to reset the timezone back to whatever you picked at installation. I just changed it with dpkg-reconfigure tzdata, as suggested, and this seemed to work. Perhaps it will survive the next tzdata upgrade.

share|improve this answer

Normally you need to

  • set the timezone using tzselect
  • then set the time using date

Afterwards, things should be correct.

So what happens if you do these two things? Could you post the output of "date"?

If time is changed correctly, but changes back later, something is interfering.

Common culprits:

  • NTP server (check for running ntpd or similar)
  • ntpdate from cronjob
  • hwclock being confused about your timezone (should only affect reboots)

If date does not change anything, something's really wrong...

share|improve this answer
    
Originally I set tzselect and date. But it got reset (without a reboot). I didn't see NTP installed or a cronjob, so I'm not quite sure what was causing the problem. –  Kris Jun 27 '09 at 17:22

I just had this problem too:

I used this to turn off UTC

http://www.linuxtopia.org/online_books/linux_beginner_books/unofficial_ubuntu_starter_guide/index_217.html

then used the ntp service and am using the default ubuntu time server.

Also made sure my lat/long regional settings were good.

Cheers

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.