From cb52ad6da3c7f591df63748822e7c001cb676854 Mon Sep 17 00:00:00 2001 From: Clint Ecker Date: Fri, 20 Jun 2014 16:14:22 -0500 Subject: [PATCH] get total seconds that works in >2.3 --- moto/sqs/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moto/sqs/utils.py b/moto/sqs/utils.py index e98f3b0c7..6ea287366 100644 --- a/moto/sqs/utils.py +++ b/moto/sqs/utils.py @@ -13,7 +13,7 @@ def unix_time(dt=None): dt = dt or datetime.datetime.utcnow() epoch = datetime.datetime.utcfromtimestamp(0) delta = dt - epoch - return delta.total_seconds() + return (delta.days * 86400) + (delta.seconds + (delta.microseconds / 1e6)) def unix_time_millis(dt=None):