diff --git a/freezegun/api.py b/freezegun/api.py index 81d4da17..62522a85 100644 --- a/freezegun/api.py +++ b/freezegun/api.py @@ -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):