From ac66b1ca1aeb98938b11a0608b98b50942646096 Mon Sep 17 00:00:00 2001 From: sschwartzcpu Date: Thu, 24 Aug 2017 00:17:34 -0500 Subject: [PATCH] time: strftime: 2nd parameter must be a struct tm tuple. As described in https://docs.python.org/3/library/time.html#time.strftime --- time/time.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/time/time.py b/time/time.py index 9223d6f7..6171bc9d 100644 --- a/time/time.py +++ b/time/time.py @@ -28,13 +28,10 @@ def _c_tm_to_tuple(tm): def strftime(format, t=None): if t is None: - t = time() + t = localtime() - t = int(t) - a = array.array('i', [t]) - tm_p = localtime_(a) buf = bytearray(32) - l = strftime_(buf, 32, format, tm_p) + l = strftime_(buf, 32, format, _tuple_to_c_tm(t)) return str(buf[:l], "utf-8")