Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a strange problem with my Ubuntu Natty virtual machine running under VirtualBox on OSX.

One day last week, my clock on the top bar in Gnome stopped displaying the correct time (I'm not running Unity). I'm on GMT, so right now it should be 9:31, but it's showing 3:31, so I think it's something to do with TimeZones.

If I go into the date and time applet, the time is initially wrong but after a second sets itself to the correct GMT Time. The timezone is correclty set as London and it makes no difference if I unlock and set it again or select manual or automatic from internet time.

From a bash prompt, the "date" command shows: "Tue Sep 20 03:33:35 CDT 2011".

If I run "sudo dpkg-reconfigure tzdata" I am correctly set as London. Upon exiting the commnand I'm shown the correct London time, but then typing "date" again shows the CDT time again.

:~/$ date
Tue Sep 20 03:33:35 CDT 2011

:~/$ sudo dpkg-reconfigure tzdata
Current default time zone: 'Europe/London'
Local time is now:      Tue Sep 20 09:34:22 BST 2011.
Universal Time is now:  Tue Sep 20 08:34:22 UTC 2011.

:~/$ date
Tue Sep 20 03:34:26 CDT 2011

The clock is correct in OSX. This has been working fine for a month or two - I think it stopped working after an update last week. Any ideas?

share|improve this question
    
My guess would be that the timezone on the host got changed to GMT and its clock set to local time or some such. –  Daniel R Hicks May 27 '12 at 11:26
    
Please check my solution at link. You have to change some details, in my case I have Windows host. –  Vladimir S. Aug 13 '13 at 1:56

3 Answers 3

I had a similar issue with ArchLinux guest in VirtualBox host. When I use TIMEZONE="Africa/Johannesburg" or TIMEZONE="Asia/Bahrain" in my rc.conf file, the output of date is correct but when I use TIMEZONE="/Etc/GMT+2" or "/Etc/GMT+3" (corresponding to aforementioned timezones) then the VBoxService sets time 6 hours to early.

My hardware clock time always remains correct (sudo hwclock --show) and setting system time from hardware clock (sudo hwclock --hctosys) sets system time correctly until VBoxService runs timesync again and output of date is 6 hours too early.

To summarize; using timezones from /usr/share/zoneinfo// seems to work but other zoneinfos might not work, I don't know why this is.

share|improve this answer

I had the exact same issue on my regular Ubuntu install. The reason turned out to be that I had installed sontek's dotfiles. In a .profile, the TZ variable was explicitly set to America/Chicago. Removing this entry fixed the problem.

What lead me to the answer was this question, and new123456's comment.

share|improve this answer

In order to change your timezone, run the following command in the shell:

$ sudo "ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime"

That command assumes that your hardware (BIOS) clock is GMT. You can scour /usr/share/zoneinfo for a better option.

share|improve this answer
    
Hi. Thanks! I've run: sudo ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime and /etc/localtime is now indeed a link to /usr/share/zoneinfo/Europe/London. However, "date" still shows CDT and my clock is still wrong. Any other idea? Thanks. –  Ludo Sep 20 '11 at 10:50
    
@Ludo I also hear that one can put export TZ="Europe/London" into your .bashrc/.zshrc. Try that. –  new123456 Sep 20 '11 at 20:00
    
Hi, thanks, after adding that to my .bashrc "date" now shows the correct time! However, the gnome clock is still wrong. Cheers :) –  Ludo Sep 26 '11 at 14:32

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.