I don't understand why log timestamps are UTC but date command is local time
I have an ntp server that I am syncing to. Does this only affect log timestamps? I don't understand why my log file timestamps are always in UTC, but when i run the date command it reports in MST or whichever timeszone i set /etc/localtime to point to. Is there a config file that defines what kind of timestamp log files get?
|
Just a guess, but certain countries use daylight saving (sadly I live in such a country), which means that at two times in the year the time is shifted one hour backwards or forwards. This would look very weird in logs and would make a grep for a specific time unreliable, so using UTC, which doesn't have daylight saving, seems natural to me to avoid confusion.
To your question, NTP sets the system time, so both, the date command and timestamps in logs are affected. |
I share your fellow hatred of Daylight "Savings" time. We all know you can't save daylight. The farmers should just get up earlier rather than screw us all over.
So syncing to an ntp server will trump any settings made by setting timezone in the following way? : cp /usr/share/zoneinfo/UTC /etc/localtime |
No, all that NTP does is syncing the system time to the server, it does not change the timezone.
|
Quote:
|
Thanks for the input, peoples. I think my problems are solved. Well... at least this particular one;)
|
All times are GMT -5. The time now is 02:00 PM. |