Skip to content

Commit

Permalink
Update utcnow func like describe in issues spulec#331 on original repos
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaudDemay committed Dec 29, 2020
1 parent be7034d commit cea003a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion freezegun/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ def today(cls):

@classmethod
def utcnow(cls):
result = cls._time_to_freeze() or real_datetime.utcnow()
if _should_use_real_time():
result = real_datetime.utcnow()
else:
result = cls._time_to_freeze() or real_datetime.utcnow()
return datetime_to_fakedatetime(result)

@staticmethod
Expand Down

0 comments on commit cea003a

Please sign in to comment.