Skip to content

Commit

Permalink
Stop using datetime.utcfromtimestamp() (bazelbuild#838)
Browse files Browse the repository at this point in the history
  • Loading branch information
aiuto authored Mar 21, 2024
1 parent a0eb69a commit f6d5046
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/private/zip/build_zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _combine_paths(left, right):


def parse_date(ts):
ts = datetime.datetime.utcfromtimestamp(ts)
ts = datetime.datetime.fromtimestamp(ts, tz=datetime.timezone.utc)
return (ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second)


Expand Down
2 changes: 1 addition & 1 deletion tests/zip/zip_test_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
_ZIP_EPOCH_S = int(_ZIP_EPOCH_DT.timestamp())

def seconds_to_ziptime(s):
dt = datetime.datetime.utcfromtimestamp(s)
dt = datetime.datetime.fromtimestamp(s, tz=datetime.timezone.utc)
return (dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second)


Expand Down

0 comments on commit f6d5046

Please sign in to comment.