diff --git a/cli/watch.py b/cli/watch.py index 4a1d668..e3c8b03 100644 --- a/cli/watch.py +++ b/cli/watch.py @@ -7,7 +7,7 @@ kin ps: one-shot list of all running pipelines with PID and current step. import json import time -from datetime import datetime +from datetime import datetime, timezone from core import models @@ -22,7 +22,7 @@ def _format_elapsed(dt_iso: str) -> str: # SQLite stores "YYYY-MM-DD HH:MM:SS"; fromisoformat requires 'T' in Python < 3.11 normalized = dt_iso.replace(' ', 'T') if ' ' in dt_iso else dt_iso started = datetime.fromisoformat(normalized) - total_secs = int((datetime.utcnow() - started).total_seconds()) + total_secs = int((datetime.now(timezone.utc).replace(tzinfo=None) - started).total_seconds()) if total_secs < 0: total_secs = 0 hours = total_secs // 3600