Ways to get number of seconds from Epoch
Joseph A Knapka
jknapka at earthlink.net
Wed May 1 17:41:24 EDT 2002
"Václav Sigmund" wrote:
>
> 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.
You can leave day-of-week and week-of-year out;
they are ignored anyway when converting a time tuple
to an epoch time.
Cheers,
-- Joe
Any OS distinguishable from Windows is not sufficiently broken.
More information about the Python-list
mailing list