chore: add pre-commit

This commit is contained in:
2024-08-04 18:47:43 +01:00
parent 0188d8e43d
commit 6c1c5edf04
7 changed files with 92 additions and 32 deletions

View File

@ -1,18 +1,18 @@
#!/usr/bin/env python3
from zoneinfo import ZoneInfo
from datetime import datetime
from zoneinfo import ZoneInfo
def timestamp_to_date(timestamp: int) -> str:
"""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")
return datetime.fromtimestamp(timestamp=timestamp, tz=ZoneInfo("UTC")).strftime(
"%Y-%m-%d"
)