Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 3b89449

Browse files
committed
fix: utcnow timestamp
1 parent b63cf62 commit 3b89449

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/oidcmsg/time_util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import time
2727
from datetime import datetime
2828
from datetime import timedelta
29+
from datetime import timezone
2930

3031
TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
3132
TIME_FORMAT_WITH_FRAGMENT = re.compile("^(\d{4,4}-\d{2,2}-\d{2,2}T\d{2,2}:\d{2,2}:\d{2,2})\.\d*Z$")
@@ -351,7 +352,7 @@ def later_than(after, before):
351352

352353

353354
def utc_time_sans_frac():
354-
now_timestampt = int(datetime.utcnow().timestamp())
355+
now_timestampt = int(datetime.now(timezone.utc).timestamp())
355356
return now_timestampt
356357

357358

0 commit comments

Comments
 (0)