I'm reading a postgres database and getting a datetime object. I'd like to save this in a text file, and then later re-read it and get an equivalent datetime object. In both cases I need to be timezone aware.
How do I do this in a way that will reliably work, even if the later re-reading is done in a different locale or timezone?