Ways to get number of seconds from Epoch

Václav Sigmund preklady at seznam.cz
Wed May 1 16:14:50 EDT 2002


I am a Python newbie and I sudenly run into following problem:

I would like to write a tool to analyze the access.log records from my
company's webserver, and it would  be very convenient for to convert dates
date of the record into number of seconds from Epoch (let's call it
"standard unix time" for convenience).

Each record have recorded time as follows:

[15/Apr/2002:08:28:56 +0200]

In my opinion, this information should be sufficient to convert the record
to "standard unix time". But function mktime from package only accepts tuple
with some additional informations like day of week etc.

In my opinion, it is the same problem to write my own function that returns
"standard unix time" as to write function which will provide me with the
additional parameters necesary to use mktime.

I don't see any good in writing such functions, so would like to as, if
there is some way to get things done with the information I have (the format
of date mentioned above)???

Thanks a lot for every tip, you can give me.

Best Regards, Vasek Sigmund






More information about the Python-list mailing list