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

Closes #405
  • Loading branch information
mkenigs committed Jul 23, 2021
1 parent bba5c0b commit 4b28a72
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 4b28a72

Please sign in to comment.