This commit is contained in:
DingZQ
2025-03-04 21:15:08 +08:00
parent afa26a561f
commit 30c4e40180

View File

@@ -1801,6 +1801,11 @@ def query_all_record_by_date_property(query_date: str, type: str, property: str,
raise ValueError(f"不支持的类型: {type}")
# 将 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()
print(str(start_time))
print("before query influxdb")
# 构建 Flux 查询语句
flux_query = f'''
from(bucket: "{bucket}")
@@ -1811,6 +1816,9 @@ def query_all_record_by_date_property(query_date: str, type: str, property: str,
'''
# 执行查询
tables = query_api.query(flux_query)
print("after query influxdb")
result_records = []
# 解析查询结果
for table in tables: