OverflowError: mktime argument out of range ???

John Machin sjmachin at lexicon.net
Tue Apr 17 08:39:27 EDT 2007


On Apr 17, 7:39 pm, "Jorgen Bodde" <jorgen.maill... at gmail.com> wrote:
> Thanks again,
>
> I will explain what happened. I am a python newbie.

Even GvR was a Python newbie once :-)

> The time and
> datetime modules are confusing at the beginning, but after diving into
> them I started to understand the structure. So what I did was using
> the time module for date storage, but I came to understand that time
> is actually more used for file dates and times. That would explain the
> epoch and 1970 boundaries as there are not much files before the
> pre-PC era to keep timestamps for.
>
> Basically it would have been clearer if the time module would have
> been called 'filetime' as datetime kind of supercedes the time by
> removing all boundaries and still presenting all methods to the user.

The time module was intended to match the functionality of the C
standard library time.h kit, and named accordingly. The datetime
module came much later.

>
> Onca again, it was confusing for someone starting with python, but I
> think I got it now. I cannot claim it was not documented, I was more
> surprised that there was a boundary and decided to ask before reading
> the python docs, sorry ....

For the benefit of those who do eventually read the docs, you may like
to propose a doc patch for the time module: a sentence or two at the
start, stating that the datetime module is more suited to general data
processing than the time module.

Cheers,
John




More information about the Python-list mailing list