Skip to content

Commit 89b8473

Browse files
committed
Fix python deprecation warning.
1 parent 788ecbe commit 89b8473

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

support/git-set-file-times

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22

33
import os, re, argparse, subprocess
4-
from datetime import datetime
4+
from datetime import datetime, UTC
55

66
NULL_COMMIT_RE = re.compile(r'\0\0commit [a-f0-9]{40}$|\0$')
77

@@ -74,7 +74,7 @@ def print_line(fn, mtime, commit_time):
7474
if args.list > 1:
7575
ts = str(commit_time).rjust(10)
7676
else:
77-
ts = datetime.utcfromtimestamp(commit_time).strftime("%Y-%m-%d %H:%M:%S")
77+
ts = datetime.fromtimestamp(commit_time, UTC).strftime("%Y-%m-%d %H:%M:%S")
7878
chg = '.' if mtime == commit_time else '*'
7979
print(chg, ts, fn)
8080

0 commit comments

Comments
 (0)