Skip to content

Commit d96ef1f

Browse files
author
jiwoomap
committed
fix: convert scheduled report times from UTC to local timezone
1 parent c51f2d7 commit d96ef1f

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

app.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,12 @@ def search_ticker_suggestions(query):
506506
# Convert UTC start_time to local timezone for display
507507
from datetime import datetime, timezone
508508
start_time_str = status_data.get("start_time", "")
509+
510+
# Get file time string for file paths (HHMMSS format from filename)
511+
file_time_str = file.split("_")[0] # HHMMSS from filename
512+
509513
if start_time_str:
510-
# Parse datetime and convert to local timezone
514+
# Parse datetime and convert to local timezone for display
511515
utc_time = datetime.fromisoformat(start_time_str)
512516
# If no timezone info, assume UTC
513517
if utc_time.tzinfo is None:
@@ -518,8 +522,7 @@ def search_ticker_suggestions(query):
518522
else:
519523
# Fallback to path-based extraction
520524
date_str = parts[1]
521-
time_str_raw = file.split("_")[0]
522-
time_str = f"{time_str_raw[:2]}:{time_str_raw[2:4]}:{time_str_raw[4:]}"
525+
time_str = f"{file_time_str[:2]}:{file_time_str[2:4]}:{file_time_str[4:]}"
523526

524527
report_files.append({
525528
"date": date_str,
@@ -531,8 +534,8 @@ def search_ticker_suggestions(query):
531534
"decision": status_data.get("decision", ""),
532535
"duration": status_data.get("duration", 0),
533536
"error": status_data.get("error", ""),
534-
"summary_path": os.path.join(root, f"{time_str}_summary.md"),
535-
"debate_path": os.path.join(root, f"{time_str}_debate.md"),
537+
"summary_path": os.path.join(root, f"{file_time_str}_summary.md"),
538+
"debate_path": os.path.join(root, f"{file_time_str}_debate.md"),
536539
"rag_enabled": status_data.get("rag_enabled", False),
537540
"rag_memory_count": status_data.get("rag_memory_count", 0),
538541
"obsidian_saved": status_data.get("obsidian_saved", False),

0 commit comments

Comments
 (0)