converting a timezone-less datetime to seconds since the epoch

Floris Bruynooghe floris.bruynooghe at
Wed Apr 7 08:38:14 EDT 2010

On Apr 7, 9:57 am, Chris Withers <ch... at> wrote:
> Chris Rebert wrote:
> > To convert from struct_time in ***UTC***
> > to seconds since the epoch
> > use calendar.timegm()
> ...and really, wtf is timegm doing in calendar rather than in time? ;-)

You're not alone in finding this strange:

(the short apologetic reason is that timegm is written in python
rather the C)


More information about the Python-list mailing list