From 3ddff235e9d4612854aee1bb03ee499f0f35cb83 Mon Sep 17 00:00:00 2001 From: Matthew Kenigsberg Date: Fri, 23 Jul 2021 17:35:07 -0400 Subject: [PATCH] Fix now(tz) 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 --- freezegun/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freezegun/api.py b/freezegun/api.py index 8e6440a3..cb78070a 100644 --- a/freezegun/api.py +++ b/freezegun/api.py @@ -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)