Skip to content

Commit

Permalink
Fix time cut-off on time_ns
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Babics committed Feb 14, 2022
1 parent 8994558 commit c370104
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion freezegun/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ def fake_time():
def fake_time_ns():
if _should_use_real_time():
return real_time_ns()
return int(int(fake_time()) * 1e9)
current_time = get_current_time()
return int(calendar.timegm(current_time.timetuple()) * 1_000_000_000 + current_time.microsecond * 1_000)


def fake_localtime(t=None):
Expand Down

0 comments on commit c370104

Please sign in to comment.