datetimes, tzinfo and gmtime epoch

Robert Brewer fumanchu at amor.org
Fri Apr 16 13:42:12 EDT 2004


John Hunter wrote:
> I have a python2.3 datetime instance and a tzinfo instance (eg Eastern
> from the python library reference).
> 
> What is the best way to convert that datetime instance to seconds
> since the epoch, gmtime?

You might try time.mktime(t), where t is a 9-tuple as desribed at:

http://docs.python.org/lib/module-time.html


FuManChu




More information about the Python-list mailing list