Skip to content
Permalink
Browse files
fix: don't offset timestamp via naive datetime (#112)
Closes #111.
  • Loading branch information
tseaver committed Oct 5, 2021
1 parent 97ebf3d commit 8fe62f992e1dc98dfb69a805afb24160de9c3b6b
Showing 1 changed file with 1 addition and 4 deletions.
@@ -210,13 +210,10 @@ def update_time(self):
try:
value = datetime.datetime.strptime(
value, datetime_helpers._RFC3339_MICROS
)
).replace(tzinfo=datetime.timezone.utc)
except ValueError:
DatetimeNS = datetime_helpers.DatetimeWithNanoseconds
value = DatetimeNS.from_rfc3339(value)
naive = value.tzinfo is None or value.tzinfo.utcoffset(value) is None
if naive:
value = value.astimezone(tz=datetime.timezone.utc)
return value

def _require_client(self, client):

0 comments on commit 8fe62f9

Please sign in to comment.