[CentOS] TimeZone Mystery on a virtual dedicated server

NiftyClusters T Mitchell niftycluster at niftyegg.com
Wed Dec 31 04:10:58 UTC 2008

On Mon, Dec 29, 2008 at 7:34 AM, Ami Mahloof <ami.mahloof at gmail.com> wrote:
> Hi,
> I have a weird problem woth the time zone on my virtual (goDaddy) dedicated
> server
> I had to setup the timezone using system-config-date to GMT+7
> i am in NY (GMT-5)
> when i do GMT-5 i get all the times 2 hours ahead
> seems like there's something im missing here
> If i add an event to my web app let's say 7:30 - 8:15 , the only way for me
> to show it right is GMT+7
> can anyone help me figure out what am i missing here???
Start with "date -u".
Since this is a 'virtual' server the hardware real time clock is virtualized and
not under your control.

You should ask how the host keeps time.   Linux has two notions of
the real time clock.   It is correct local time OR it is GMT.   In the virtual
host world there is a third case where your local time is not local time
for the hardware.

It may be that you need to use ntpdate at start time and ntp normally.

It may also help to have system time set to hardware local time
and add an environment variable (TZ) for users.   This works as long
as "date -u" returns correct UTS time (GMT).

        T o m   M i t c h e l l

More information about the CentOS mailing list