This commit is contained in:
DingZQ
2025-02-24 20:31:52 +08:00
parent 294fea9aa8
commit 486471f3e8

View File

@@ -1353,7 +1353,7 @@ def query_all_record_by_date(query_date: str, bucket: str="realtime_simulation_r
query_api = client.query_api()
# 将 start_date 的北京时间转换为 UTC 时间
start_time = (datetime.strptime(query_date, "%Y-%m-%d") - timedelta(days=1)).replace(hour=16, minute=0, second=0, tzinfo=timezone.utc).isoformat()
stop_time = start_time + timedelta(hours=2)
stop_time = (datetime.strptime(query_date, "%Y-%m-%d") - timedelta(days=1)).replace(hour=19, minute=0, second=0, tzinfo=timezone.utc).isoformat()
# 构建 Flux 查询语句
flux_query = f'''
from(bucket: "{bucket}")