Skip to content

Commit

Permalink
Use aware timezone internally in timestamped formatting
Browse files Browse the repository at this point in the history
Avoids using `datetime.utcfromtimestamp`, deprecated since Python 3.12.
  • Loading branch information
scop committed Jun 10, 2023
1 parent 23b61be commit 12e8089
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions jaraco/logging.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import logging
import time
import datetime
import string
import http.client

Expand Down Expand Up @@ -133,7 +132,7 @@ def get_filename(self, t):
if self._period_seconds:
t -= t % self._period_seconds
# convert it to a datetime object for formatting
dt = datetime.datetime.utcfromtimestamp(t)
dt = tempora.utc.fromtimestamp(t)
# append the datestring to the filename
# workaround for datetime.strftime not handling '' properly
appended_date = (
Expand Down

0 comments on commit 12e8089

Please sign in to comment.