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 Nov 3, 2021
1 parent 8994558 commit ae4a10a
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 @@ -385,7 +385,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 ae4a10a

Please sign in to comment.