Skip to content

Commit

Permalink
do not use timestamp()
Browse files Browse the repository at this point in the history
  • Loading branch information
girarda committed Aug 10, 2022
1 parent 28f0588 commit 016cb69
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,4 @@ def format(self, dt: datetime.datetime, format: str) -> str:
# strftime("%s") is unreliable because it ignores the time zone information and assumes the time zone of the system it's running on
# It's safer to use the timestamp() method than the %s directive
# See https://stackoverflow.com/a/4974930
if format == "%s":
return str(int(dt.timestamp()))
else:
return dt.strftime(format)
return dt.strftime(format)

0 comments on commit 016cb69

Please sign in to comment.