Shaun Wingrin
asked on
log file time and date different from linux system time and date???
Say, date returns 6 hours ahead of the date and time in the log files? Why and how can I correct it to log as system date?
ASKER
I actually solved it with this:
[root@messaging etc]# rm /etc/localtime
rm: remove regular file `/etc/localtime'? y
[root@messaging etc]# ln -s /usr/share/zoneinfo/Africa /Johannesb urg /etc/localtime
[root@messaging etc]# date
Sun Mar 18 23:22:03 SAST 2012
[root@messaging etc]# rm /etc/localtime
rm: remove regular file `/etc/localtime'? y
[root@messaging etc]# ln -s /usr/share/zoneinfo/Africa
[root@messaging etc]# date
Sun Mar 18 23:22:03 SAST 2012
Didn't work for me - that solution makes my clock 6 hours fast for some reason... the same symptom that's supposed to fix!
try to install ntpd (network time protocol)
#yum install ntpd
and copy any ntp server from pool list, this should be in the file /etc/ntp.conf and check the time with ntpdate command
#ntpdate 0.centos.pool.ntp.org
this should return the correct time. If the times is matching,
start the ntp service,
#service ntpd start
#chkconfig --add ntpd
#chkconfig ntpd on
#yum install ntpd
and copy any ntp server from pool list, this should be in the file /etc/ntp.conf and check the time with ntpdate command
#ntpdate 0.centos.pool.ntp.org
this should return the correct time. If the times is matching,
start the ntp service,
#service ntpd start
#chkconfig --add ntpd
#chkconfig ntpd on
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
/var/lib/ntp/ntp.drift is blank
Also, which Linux distro are you using and what timezone is it set to?