From 6adc26a897a873265796d03b2c33cfb0823803be Mon Sep 17 00:00:00 2001 From: Matt Wright Date: Wed, 9 Jan 2013 14:02:42 -0500 Subject: [PATCH] Get rid of `strftime` in favor of `total_seconds`. Fixes #67 --- flask_security/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_security/utils.py b/flask_security/utils.py index 5531ec0..547e231 100644 --- a/flask_security/utils.py +++ b/flask_security/utils.py @@ -196,7 +196,7 @@ def config_value(key, app=None, default=None): def get_max_age(key, app=None): now = datetime.utcnow() expires = now + get_within_delta(key + '_WITHIN', app) - return int(expires.strftime('%s')) - int(now.strftime('%s')) + return (expires - now).total_seconds() def get_within_delta(key, app=None):