Skip to content

Commit a6b31ad

Browse files
authored
support: use a keyword argument for datetime.fromtimestamp (#1146)
This is how it's documented, cf. * https://docs.python.org/3/library/datetime.html#datetime.datetime.fromtimestamp * https://docs.python.org/3/library/datetime.html#datetime.datetime.utcfromtimestamp Quoting from the doc: > the recommended way to create an object representing a specific > timestamp in UTC is by calling datetime.fromtimestamp(timestamp, > tz=timezone.utc). This is just a nit, it doesn't _fix_ anything, it's just better style IMO.
1 parent 41bbd89 commit a6b31ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎support/git-set-file-times‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def print_line(fn, mtime, commit_time):
8181
if args.list > 1:
8282
ts = str(commit_time).rjust(10)
8383
else:
84-
ts = datetime.fromtimestamp(commit_time, timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
84+
ts = datetime.fromtimestamp(commit_time, tz=timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
8585
chg = '.' if mtime == commit_time else '*'
8686
print(chg, ts, fn)
8787

0 commit comments

Comments
 (0)