Skip to content

Commit 1678928

Browse files
authored
updated utcnow
1 parent c0af7e9 commit 1678928

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Lib/datetime.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,14 +1708,13 @@ def utcfromtimestamp(cls, t):
17081708
@classmethod
17091709
def now(cls, tz=None):
17101710
"Construct a datetime from time.time() and optional time zone info."
1711-
t = _time.time_ns()
1712-
t = t / 1e9
1711+
t = _time.time_ns() / 1e9
17131712
return cls.fromtimestamp(t, tz)
17141713

17151714
@classmethod
17161715
def utcnow(cls):
17171716
"Construct a UTC datetime from time.time()."
1718-
t = _time.time_ns()
1717+
t = _time.time_ns() / 1e9
17191718
return cls.utcfromtimestamp(t)
17201719

17211720
@classmethod

0 commit comments

Comments
 (0)