* Add APM
* Fix unit tests
* Remove apm.py
* Add SonarCloud recommendations
* SonarCloud python:S6890
This commit is contained in:
2024-04-21 16:17:00 +01:00
committed by GitHub
parent 97be51bd59
commit 123ed8aa15
10 changed files with 124 additions and 26 deletions

View File

@ -1,7 +1,18 @@
#!/usr/bin/env python3
from zoneinfo import ZoneInfo
from datetime import datetime
def timestamp_to_date(timestamp: int) -> str:
return datetime.utcfromtimestamp(timestamp).strftime("%Y-%m-%d")
"""Convert timestamp to date.
Args:
timestamp (int): Timestamp to convert.
Returns:
str: Date in the format YYYY-MM-DD.
"""
return datetime.fromtimestamp(timestamp=timestamp, tz=ZoneInfo("UTC")).strftime("%Y-%m-%d")