Re: converting datetime object in UTC to local time

2007-07-06 Thread i3dmaster
How about subclass datetime.tzinfo? That way you can use asttimezone to transfer utc to localtime. It requires an aware object though not naive. A bit more coding, but a lot less converting... Jim On Jul 3, 5:16 pm, Matt <[EMAIL PROTECTED]> wrote: > Hi all, > > So a lot of digging on doing this a

converting datetime object in UTC to local time

2007-07-03 Thread Matt
Hi all, So a lot of digging on doing this and still not a fabulous solution: import time # this takes the last_modified_date naive datetime, converts it to a # UTC timetuple, converts that to a timestamp (seconds since the # epoch), subtracts the timezone offset (in seconds), and then converts #