What is the best way to convert a zope DateTime object into Python datetime object?
I need to convert a zope 2 DateTime object into a Python datetime object. What is the best way to do that? Thanks, Erika modernthingy = datetime.datetime.fromtimestamp(zopethingy.timeTime()) The datetime instance is timezone-naive; if you need to support timezones (as Zope2's DateTime does), I recommend third-party extension package pytz . Newer DateTime implementations (2.11 and up) have a asdatetime method that returns a python datetime.datetime instance: modernthingy = zopethingy.asdatetime() If you mean this one .strftime('%m/%d/%Y %H:%M') = 04/25/2005 10:19 then reverse is >>> time