SonarCloud python:S6890

This commit is contained in:
Luke Tainton 2024-04-21 16:09:40 +01:00
parent 8cb6f104a9
commit e9321704d5
2 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import pytz from zoneinfo import ZoneInfo
from datetime import datetime from datetime import datetime
@ -14,5 +14,5 @@ def timestamp_to_date(timestamp: int) -> str:
Returns: Returns:
str: Date in the format YYYY-MM-DD. str: Date in the format YYYY-MM-DD.
""" """
return datetime.fromtimestamp(timestamp=timestamp, tz=pytz.utc).strftime("%Y-%m-%d") return datetime.fromtimestamp(timestamp=timestamp, tz=ZoneInfo("UTC")).strftime("%Y-%m-%d")

View File

@ -30,7 +30,6 @@ PyJWT==2.8.0
pyparsing==3.1.2 pyparsing==3.1.2
python-dateutil==2.9.0.post0 python-dateutil==2.9.0.post0
python-dotenv==1.0.1 python-dotenv==1.0.1
pytz==2024.1
PyYAML==6.0.1 PyYAML==6.0.1
requests==2.31.0 requests==2.31.0
requests-toolbelt==1.0.0 requests-toolbelt==1.0.0