Initialer Push, Grundsätzlich funktioniert das Programm

This commit is contained in:
2026-07-09 23:00:31 +02:00
parent 70088f7861
commit 952bbb6158
51 changed files with 3066 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
"""Gemeinsame Formatierungshelfer für die GUI (Dauer- und Zeitstempelanzeige)."""
from __future__ import annotations
from datetime import datetime
def format_duration(seconds: float) -> str:
total_seconds = max(0, int(seconds))
hours, remainder = divmod(total_seconds, 3600)
minutes, secs = divmod(remainder, 60)
if hours:
return f"{hours:02d}:{minutes:02d}:{secs:02d}"
return f"{minutes:02d}:{secs:02d}"
def format_timestamp(iso_timestamp: str) -> str:
try:
return datetime.fromisoformat(iso_timestamp).strftime("%d.%m.%Y %H:%M:%S")
except ValueError:
return iso_timestamp