From 9f29755e0fd4143bbeeb3147ef0e7b7ceca3c7bb Mon Sep 17 00:00:00 2001 From: ziesorx Date: Thu, 25 Sep 2025 11:24:45 +0700 Subject: [PATCH] feat: update filename and timestamp to gmt+7 --- core/communication/websocket.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/communication/websocket.py b/core/communication/websocket.py index 9def134..813350e 100644 --- a/core/communication/websocket.py +++ b/core/communication/websocket.py @@ -6,7 +6,7 @@ import json import logging import os import cv2 -from datetime import datetime +from datetime import datetime, timezone, timedelta from pathlib import Path from typing import Optional from fastapi import WebSocket, WebSocketDisconnect @@ -483,8 +483,8 @@ class WebSocketHandler: images_dir.mkdir(exist_ok=True) # Generate filename with timestamp and session ID - timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") - filename = f"{display_identifier}_{session_id}_{timestamp}.jpg" + timestamp = datetime.now(tz=timezone(timedelta(hours=7))).strftime("%Y%m%d_%H%M%S") + filename = f"{session_id}_{display_identifier}_{timestamp}.jpg" filepath = images_dir / filename # Use existing HTTPSnapshotReader to fetch snapshot