Skip to content

Commit

Permalink
Merge pull request #828 from googlefonts/fix-deprecated-utcfromtimestamp
Browse files Browse the repository at this point in the history
Fix DeprecationWarning: datetime.datetime.utcfromtimestamp()
  • Loading branch information
anthrotype authored Mar 20, 2024
2 parents aede63e + 9a7920a commit 1223bec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/ufo2ft/fontInfoData.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os
import time
import unicodedata
from datetime import datetime
from datetime import datetime, timezone

from fontTools import ufoLib
from fontTools.misc.fixedTools import otRound
Expand Down Expand Up @@ -104,7 +104,7 @@ def openTypeHeadCreatedFallback(info):
now.
"""
if "SOURCE_DATE_EPOCH" in os.environ:
t = datetime.utcfromtimestamp(int(os.environ["SOURCE_DATE_EPOCH"]))
t = datetime.fromtimestamp(int(os.environ["SOURCE_DATE_EPOCH"]), timezone.utc)
return t.strftime(_date_format)
else:
return dateStringForNow()
Expand Down

0 comments on commit 1223bec

Please sign in to comment.