Help - Search - Members - Calendar
Full Version: Setting Timezone - how!?
The Planet Forums > Operating Systems > Red Hat Linux
Ross
Hi all,

I seem to be having problems setting the time/timezone on my server. I want to set the server to London time. I've tried:

date -s 'Wed May 4 12:38 GMT 2005'

and still can't get this work. The time changes, but to something totally different to what I specified.

Any help would be great.
jaume
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
date -s 'Wed May 4 12:38 GMT 2005'
hwclock --systohc

icon_smile.gificon_smile.gif
Yivit
There's three things to check.

1. The timezone setting for the server. The is /etc/localtime. If you look in the /usr/share/zoneinfo/ directory structure you'll find the appropriate timezone that you wish to use. Then issue these commands (I'll use US Central Time in the example):
CODE
mv /etc/locatime /etc/localtimeOLD

ln -s /usr/share/zoneinfo/US/Central /etc/localtime

2. The system date for the server. You already know how to do this one. Do a 'date' command to grab what it thinks the time is after you set your TZ correctly, then set it with 'date -s'
3. The hardware date for the server. Sync the hardware clock to what the OS says the time is:
CODE
hwclock --systohc


That should do it!

One note: If this is a VPS all you can do is change the timezone.
jaume
Hehe .. .I was faster icon_razz.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.