diff --git a/app.py b/app.py index 36ff85d..c636e3b 100644 --- a/app.py +++ b/app.py @@ -1020,7 +1020,7 @@ def logs_view(): "start_time": f_start, "end_time": f_end, }, cfg=cfg, - last_sync=log_storage.get_last_sync_at(), + last_sync=log_storage.get_last_sync_at_local(), last_sync_path=log_storage.get_last_sync_path(), use_persistent=use_persistent, format_bytes=log_parser.format_bytes, diff --git a/log_storage.py b/log_storage.py index c9e5e05..ecc4fd8 100644 --- a/log_storage.py +++ b/log_storage.py @@ -797,6 +797,23 @@ def get_last_sync_path() -> str | None: return None +def get_last_sync_at_local() -> str | None: + """Return the last-sync timestamp formatted in local time (not UTC). + + :class:`~app.AppConfig` stores the sync time as an ISO-8601 UTC string + (e.g. ``2026-07-16T07:43:36Z``). This converts it to the system's local + timezone so the UI shows a human-friendly time to the operator. + """ + ts = get_last_sync_at() + if not ts: + return None + try: + dt = datetime.fromisoformat(ts.replace("Z", "+00:00")) + return dt.astimezone().strftime("%Y-%m-%d %H:%M:%S") + except Exception: + return ts + + def import_full_history( path: str, instance_id: int = 0,