CentOS change date.

kan3

Verified User
Joined
Nov 15, 2010
Messages
28
Hello,

Can someone please help me in changing the date of OS?

This is the current date,

Tue Nov 22 04:14:00 EST 2011


I want to change the time to GMT +0 with daylight saving disabled.


Thank you.
 
did you try use ntp protocol?

Code:
yum install -y ntpdate
/usr/sbin/ntpdate -b time.ien.it
Change time.ien.it with your prefer ntp server if you want.

Did you set correct timezone? If not do:
Code:
ln -sf /usr/share/zoneinfo/GMT0 /etc/localtime

Regards
 
The following works for me on CentOS, but your mileage may vary.
Code:
# cd /etc
# cp -p localtime localtime.orig
# cp /usr/share/zoneinfo/UTC localtime
I'm not sure why there are multiple GMT files in /usr/share/zoneinfo; I'd use UTC because by definition it's more precise and by definition doesn't change for DST.

Interesting stuff here (wikipedia.org).

Jeff
 
Back
Top