Skip to content

Commit 7ab267a

Browse files
authored
Fix #626 pkcompat.utcnow returns offset naive timestamps (#627)
1 parent fe4e476 commit 7ab267a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pykern/pkcompat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import os
2020
import subprocess
2121
import sys
22+
import time
2223

2324

2425
def from_bytes(value):
@@ -104,7 +105,7 @@ def utcnow():
104105
Returns:
105106
datetime.datetime: current time in UTC
106107
"""
107-
return datetime.datetime.now(datetime.timezone.utc)
108+
return datetime.datetime.fromtimestamp(time.time())
108109

109110

110111
def zip_strict(*iterables):

0 commit comments

Comments
 (0)