>> > I have noticed that the Apache log file timestamp and OS time(checked
>> > using date OS command ) has some time difference (approximately 13
>> > hrs ) . Any possible reasons for this ?
>> Apache logs in UTC.
> If that is the case, how would i Synchronise both the Apache log
> timestamp and OS time ?
The OS time *is* the same as Apache time. (Correctly so.)
There are two different concepts here. Apache logs in UTC - which is
what the OS works with. By default you are given local "wall clock" time,
which will be adjusted from UTC depending on what timezone you have got
set up on your system.
This is correct - consider three different users: one is in Guyana
(where there is no daylight savings time adjustment; it's always four
hours behind UTC), one is here in the UK, and one is whereever you are
(India?) Assuming each user had set the TZ variable to indicate their
respective timezones, we would all see a different "wall clock" time
from date and other utilities. At the moment it's 9.27am here (GMT). That
means it's 5.27am in Guyana, and maybe 10.27pm whereever you are. There
are all correct representations of the current OS time (05:27 UTC).
$ echo "User configured timezone is '$TZ'"; date
User configured timezone is ''
Fri Jan 10 09:27:00 GMT 2003
$ date -u # UTC (OS time)
Fri Jan 10 09:27:01 GMT 2003
$ TZ=EST date # New York
Fri Jan 10 04:27:02 EST 2003
$ TZ=GB date # UK
Fri Jan 10 09:27:03 GMT 2003
$ TZ=GMT4 date # Guyana
Fri Jan 10 05:27:04 GMT 2003
Quote:> I do have few more instances of Apache server on other linux boxes
> and When i checked the log files of those ,it matchs exactly with the
> OS time (date command) even though the OS time is not in UTC / GMT.
In that case the servers are set up differently from that which was
intended by design, and are not running on UTC. If this is how you want
to set up your servers then that's fine - after all, they are your
servers. They will not give you proper results, however, if you ever
need to do any multiple timezone work.
Quote:> Thu Jan 9 09:48:53 IST 2003
My system recognises neither EAT nor IST so I can't give you concrete
examples. I presume these are local timezone names for whatever country
and/or region you are in.