后端统一时区为 UTC
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import ast
|
||||
import json
|
||||
from datetime import date
|
||||
from datetime import date, datetime
|
||||
|
||||
import geopandas as gpd
|
||||
import pandas as pd
|
||||
@@ -8,6 +8,7 @@ import psycopg
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from app.core.config import get_pgconn_string
|
||||
from app.services.time_api import parse_utc_time
|
||||
|
||||
|
||||
# 2025/03/23
|
||||
@@ -89,7 +90,7 @@ def store_scheme_info(
|
||||
scheme_name: str,
|
||||
scheme_type: str,
|
||||
username: str,
|
||||
scheme_start_time: str,
|
||||
scheme_start_time: datetime | str,
|
||||
scheme_detail: dict,
|
||||
):
|
||||
"""
|
||||
@@ -112,13 +113,16 @@ def store_scheme_info(
|
||||
"""
|
||||
# 将字典转换为 JSON 字符串
|
||||
scheme_detail_json = json.dumps(scheme_detail)
|
||||
normalized_scheme_start_time = parse_utc_time(
|
||||
scheme_start_time, field_name="scheme_start_time"
|
||||
)
|
||||
cur.execute(
|
||||
sql,
|
||||
(
|
||||
scheme_name,
|
||||
scheme_type,
|
||||
username,
|
||||
scheme_start_time,
|
||||
normalized_scheme_start_time,
|
||||
scheme_detail_json,
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user