From c6507268653141101d5f00bbfaf9ed9baa7cb85d Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 26 Mar 2022 10:00:38 +0000 Subject: (files.py): Be explicit about mtimes being UTC Signed-off-by: Daniel Silverstone --- share/python/lib/files.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/python/lib/files.py b/share/python/lib/files.py index 3ea5877..8bc512a 100644 --- a/share/python/lib/files.py +++ b/share/python/lib/files.py @@ -1,4 +1,4 @@ -from time import strptime +from datetime import datetime import logging import os @@ -117,8 +117,8 @@ def files_match(ctx, filename1=None, filename2=None): def files_touch_with_timestamp(ctx, filename=None, mtime=None): - t = strptime(mtime, "%Y-%m-%d %H:%M:%S") - ts = time.mktime(t) + t = datetime.strptime(mtime + " +0000", "%Y-%m-%d %H:%M:%S %z") + ts = t.timestamp() _files_touch(filename, ts) -- cgit v1.2.1