KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How do I set the timezone of a datetime instance that just came out of the datastore? When it first comes out it is in UTC. I want to change it to EST. I'm trying, for example: class Book( db.Model ): creationTime = db.DateTimeProperty() When a Book is retrieved, I want to set its tzinfo immediately: book.creationTime.tzinfo = EST Where I use this example for my EST object However I get: attribute 'tzinfo' of 'datetime.datetime' objects is not writable I've seen a number of answers that recommend pytz and python-dateutil, but I really want an answer to this question.
Tags (comma-separated)
Save Edits
Cancel