mktime overflow in March 2008?

Wojtek Walczak gminick at nie.ma.takiego.adresu.w.sieci.pl
Thu Aug 7 15:20:29 EDT 2008


Dnia 7 Aug 2008 18:40:10 GMT, Robert Latest napisa³(a):
>>>> t = time.strptime("Mar 30, 2008 2:43:32 am", "%b %d, %Y %I:%M:%S
>>>> %p")
>>>> time.mktime(t)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> OverflowError: mktime argument out of range
>>>> 

time module is written in C. time.mktime() function is actually
only a wrapper for mktime(3) and it also has its limits. Better
use datetime module instead.

-- 
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/



More information about the Python-list mailing list