Skip to content

Commit

Permalink
remove time zone information
Browse files Browse the repository at this point in the history
  • Loading branch information
huettenhain committed Nov 19, 2024
1 parent 8ca38d3 commit 69bd639
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions refinery/lib/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,10 @@ def date_from_timestamp(ts: int):
Convert a UTC timestamp to a datetime object.
"""
if sys.version_info >= (3, 12):
return datetime.datetime.fromtimestamp(ts, datetime.UTC)
dt = datetime.datetime.fromtimestamp(ts, datetime.UTC)
else:
return datetime.datetime.utcfromtimestamp(ts)
dt = datetime.datetime.utcfromtimestamp(ts)
return dt.replace(tzinfo=None)


def integers_of_slice(s: slice) -> Iterable[int]:
Expand Down

0 comments on commit 69bd639

Please sign in to comment.