Find the answer to your Linux question:
Results 1 to 4 of 4
I have a number of CentOS 5.5 virtual machines running on VMware ESXi 4. Most of them are fine, but one of them has the incorrect time and no matter ...
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    8

    Unable to set correct time

    I have a number of CentOS 5.5 virtual machines running on VMware ESXi 4. Most of them are fine, but one of them has the incorrect time and no matter what I try I can't get it to display properly. The time seems to be 15 hours behind and I think that might be because the original source virtual machine was an appliance built in Canada and my timezone is Australia/Sydney.

    /etc/sysconfig/clock:

    UTC=true
    ARC=false
    ZONE="Australia/Sydney"


    ls -l /etc/localtime:

    lrwxrwxrwx 1 root root 36 Mar 29 09:05 /etc/localtime -> /usr/share/zoneinfo/Australia/Sydney


    I've run:
    ntpdate pool.ntp.org
    hwclock --systohc


    I thought that was all of the settings I needed to make. Is there something else I've missed? Why can't I get the time right?

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    1,940
    Had a similar problem several months ago with my time being one hour off. Tried pretty much what you post above and it didn't work. Eventually just checked the /etc/localtime file which of course was incorrect. This file should show your zone on the bottom line. My solution was to copy the specific file for my location to the /etc directory and rename it to /etc/localtime. I renamed the original /etc/localtime file first, just in case.

    Don't know if this will work for you or if it has anything to do with it being a link, my /etc/localtime isn't a lin and this worked for me.

  3. #3
    Just Joined!
    Join Date
    Sep 2008
    Posts
    8
    Quote Originally Posted by yancek View Post
    Eventually just checked the /etc/localtime file which of course was incorrect. This file should show your zone on the bottom line. My solution was to copy the specific file for my location to the /etc directory and rename it to /etc/localtime.
    Thanks for that - it worked! It looks like my Sydney timezone file was corrupt so I copied one from another machine and now the time's correct. I left /etc/localtime as a link to it.

  4. #4
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    1,940
    I was curious as to whether it being a link had anything to do with the problem, looks like not. Glad it worked for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...