I'm trying to prettify ObjectIDs timestamp with py-pretty but it keeps giving me a TypeError:
TypeError: can't compare offset-naive and offset-aware datetimes
even after I attempt convert the timestamp to a timezone unaware UTC date with Pytz. This is the code I'm trying
import datetime
import pytz
import pretty
# ...
song = db.songs.find_one( { 'GUID' : 0123 } )
dateTimeUnaware = song['_id'].generation_time.now(pytz.utc)
prettyDate = pretty.date( dateTimeUnaware )
Why does this keep giving me the type error? Shouldn't the pytz function make it timezone agnostic?
dateTimeUnaware = song['_id'].generation_time.now()- Pykler