From edd56e2eaca0e3098ce98ea18f61170efc178b67 Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Fri, 5 Nov 2021 09:43:43 +0100 Subject: [PATCH] Was mixing UTC timezone and local timezone. --- src/cryptojwt/jwt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptojwt/jwt.py b/src/cryptojwt/jwt.py index c8d100b0..205f6344 100755 --- a/src/cryptojwt/jwt.py +++ b/src/cryptojwt/jwt.py @@ -27,7 +27,7 @@ def utc_time_sans_frac(): :return: A number of seconds """ - return int((datetime.utcnow() - datetime(1970, 1, 1)).total_seconds()) + return int(datetime.utcnow().timestamp()) def pick_key(keys, use, alg="", key_type="", kid=""):