fix(heartbeat): inject shared current time context into phase 1
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import json
|
||||
import re
|
||||
import time
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
@@ -33,6 +34,13 @@ def timestamp() -> str:
|
||||
return datetime.now().isoformat()
|
||||
|
||||
|
||||
def current_time_str() -> str:
|
||||
"""Human-readable current time with weekday and timezone, e.g. '2026-03-15 22:30 (Saturday) (CST)'."""
|
||||
now = datetime.now().strftime("%Y-%m-%d %H:%M (%A)")
|
||||
tz = time.strftime("%Z") or "UTC"
|
||||
return f"{now} ({tz})"
|
||||
|
||||
|
||||
_UNSAFE_CHARS = re.compile(r'[<>:"/\\|?*]')
|
||||
|
||||
def safe_filename(name: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user