[mod_python] Different Times in Apache Log, and within PSP files

Graham Dumpleton grahamd at dscpl.com.au
Wed Sep 14 22:23:32 EDT 2005


On 12/09/2005, at 6:45 PM, Simon Wittber wrote:

> Hello Chaps,
>
> I am encountering a problem, where a mod_python PSP page is reporting
> a different time from the datetime.datetime.today() call than the
> system time.
>
> Also, in the Apache2 logs below, it appears that something weird is
> happening with the timestamp field. Any ideas on what might be going
> on? We are using the MPM-worker model.
>
> Sw.
>
> xxx.xxx.xxx.xxx - 600030 [12/Sep/2005:07:55:18 +0800] "GET /some/file/
> HTTP/1.1" 200 1792 "http://some/referrer/file.psp" "Mozilla/5.0
> (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050410"
> xxx.xxx.xxx.xxx - 600030 [11/Sep/2005:18:55:18 -0500] "GET
> /some/other/file HTTP/1.1" 200 41610 "http://some/referrer/file.psp"
> "Mozilla/5.0 (Windows;U; Windows NT 5.1; en-US; rv:1.7.7)
> Gecko/20050410"

Note the presence of "+0800" and "-0500". Each time is probably the
same but is being output as being in relation to different timezones.

Something, it may even not be a part of mod_python but some distinct
Apache module is possibly manipulating the timezone settings and thus
causing dates to be shown differently.

One way of manipulating the timezone setting is by setting the "TZ"
environment variable. This would not be a good thing to do if the worker
MPM was being used. This is because changing the environment variable
in a request handler running in one thread, would affect the environment
variable as seen by other threads, including code run by Apache to
create the above lines in the log file.

Graham



More information about the Mod_python mailing list