summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2022-03-26 10:00:38 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2022-03-26 10:00:38 +0000
commitc6507268653141101d5f00bbfaf9ed9baa7cb85d (patch)
tree8bafacb2a0325ac8b87bb0e62d30b5e8304e6707 /share
parentfab67b9481a8df42656b1bb0777d818bb350bd17 (diff)
downloadsubplot-c6507268653141101d5f00bbfaf9ed9baa7cb85d.tar.gz
(files.py): Be explicit about mtimes being UTC
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'share')
-rw-r--r--share/python/lib/files.py6
1 files changed, 3 insertions, 3 deletions
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)