Poll.end_datetime, Tweet.created_at, and User.created_at are now aware, rather than naive, datetime objects.
Resolves #1634
self.end_datetime = data.get("end_datetime")
if self.end_datetime is not None:
self.end_datetime = datetime.datetime.strptime(
- self.end_datetime, "%Y-%m-%dT%H:%M:%S.%fZ"
+ self.end_datetime, "%Y-%m-%dT%H:%M:%S.%f%z"
)
self.voting_status = data.get("voting_status")
self.created_at = data.get("created_at")
if self.created_at is not None:
self.created_at = datetime.datetime.strptime(
- self.created_at, "%Y-%m-%dT%H:%M:%S.%fZ"
+ self.created_at, "%Y-%m-%dT%H:%M:%S.%f%z"
)
self.entities = data.get("entities")
self.created_at = data.get("created_at")
if self.created_at is not None:
self.created_at = datetime.datetime.strptime(
- self.created_at, "%Y-%m-%dT%H:%M:%S.%fZ"
+ self.created_at, "%Y-%m-%dT%H:%M:%S.%f%z"
)
self.description = data.get("description")