| Author |
Message |
Tayne
Joined: 19 Nov 2011
Posts: 5
|
| Posted: Sat Nov 19, 2011 11:08 pm Post subject: Log timestamp differs from system time |
|
|
My system's timezone is set to PST and the date command reflects this, however my log files all correspond to three hours ahead, or EST. I'm running CentOS 6.0 and have altered my time zone settings a couple times in the past.
Browsed around a decent bit, but didn't uncover anything that answered my question/solved the problem. Any information and help is appreciated! |
|
| Back to top |
|
hybinet
Joined: 02 May 2008
Posts: 1058
|
| Posted: Sun Nov 20, 2011 3:47 pm Post subject: |
|
|
Is your system's timezone set to PST, or is it just for your user? Some methods of changing the timezone only changes it for the current user.
If you changed your system's timezone, did you reboot since then? Or at least restart some services? Some programs might keep using the timezone they saw when they started up.
On a related note, everything on a server should be UTC/GMT. It's not fun trying to read log files during those two hours a year when all U.S. timezones suddenly change! |
|
| Back to top |
|
Tayne
Joined: 19 Nov 2011
Posts: 5
|
| Posted: Sun Nov 20, 2011 9:27 pm Post subject: |
|
|
Edit: Figured it out, ended up being really simple. Thanks for pointing me in the right direction, hybinet. In case future new users run into the same trouble, just had to use the following command:
Code: service rsyslog restart
I believe it's set to PST on the system. I used the following command to set it:
Code: ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime
I haven't rebooted since I changed it, I only restarted the Apache service since that was my main reason for changing it. Which other services would need to be restarted?
Thanks for the tip regarding UTC/GMT as well! I'll keep it in mind! |
|
| Back to top |
|
| |