Skip to content

Commit

Permalink
Fix now(tz)
Browse files Browse the repository at this point in the history
now(tz) should return the same time utcnow returns adjusted by whatever
offset is contained by tz. Currently, the offset to freeze_time is also
added, which is removed by this change
  • Loading branch information
mkenigs committed Jul 23, 2021
1 parent bba5c0b commit 3ddff23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion freezegun/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def timestamp(self):
def now(cls, tz=None):
now = cls._time_to_freeze() or real_datetime.now()
if tz:
result = tz.fromutc(now.replace(tzinfo=tz)) + cls._tz_offset()
result = tz.fromutc(now.replace(tzinfo=tz))
else:
result = now + cls._tz_offset()
return datetime_to_fakedatetime(result)
Expand Down

0 comments on commit 3ddff23

Please sign in to comment.