]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Fix python deprecation warning.
authorWayne Davison <wayne@opencoder.net>
Thu, 16 Jan 2025 06:36:29 +0000 (22:36 -0800)
committerWayne Davison <wayne@opencoder.net>
Thu, 16 Jan 2025 06:36:29 +0000 (22:36 -0800)
support/git-set-file-times

index e06f07370abeaba0d56a0ecb557c239b282a98c8..601248b906574e12278b2e543a3b30c8b9f40f75 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 
 import os, re, argparse, subprocess
-from datetime import datetime
+from datetime import datetime, UTC
 
 NULL_COMMIT_RE = re.compile(r'\0\0commit [a-f0-9]{40}$|\0$')
 
@@ -74,7 +74,7 @@ def print_line(fn, mtime, commit_time):
     if args.list > 1:
         ts = str(commit_time).rjust(10)
     else:
-        ts = datetime.utcfromtimestamp(commit_time).strftime("%Y-%m-%d %H:%M:%S")
+        ts = datetime.fromtimestamp(commit_time, UTC).strftime("%Y-%m-%d %H:%M:%S")
     chg = '.' if mtime == commit_time else '*'
     print(chg, ts, fn)