Fix tests

This commit is contained in:
Kylian Schmidt
2026-04-22 14:42:25 +02:00
parent 27ea17246c
commit bec86d0f07
8 changed files with 132 additions and 56 deletions
+30
View File
@@ -0,0 +1,30 @@
"""Date and time utility functions."""
from datetime import datetime
def datetime_from_timestamp(timestamp: float) -> datetime:
"""
Convert a Unix timestamp to a datetime object.
Args:
timestamp: Unix timestamp as float
Returns:
datetime object
"""
return datetime.fromtimestamp(timestamp)
def strftime_filter(dt: datetime, fmt: str) -> str:
"""
Format a datetime object using strftime.
Args:
dt: datetime object to format
fmt: strftime format string
Returns:
Formatted datetime string
"""
return dt.strftime(fmt)