Spaces:
Running
Running
修正日期处理逻辑,确保从日期转换为时间戳时小时、分钟、秒和微秒均为零
Browse files- logging_helper.py +4 -2
logging_helper.py
CHANGED
|
@@ -324,8 +324,10 @@ class LoggingHelper:
|
|
| 324 |
"""
|
| 325 |
from_timestamp = None
|
| 326 |
if from_date is not None:
|
| 327 |
-
from_datetime =
|
| 328 |
-
|
|
|
|
|
|
|
| 329 |
)
|
| 330 |
from_timestamp = from_datetime.isoformat(timespec="microseconds")
|
| 331 |
to_timestamp = None
|
|
|
|
| 324 |
"""
|
| 325 |
from_timestamp = None
|
| 326 |
if from_date is not None:
|
| 327 |
+
from_datetime = (
|
| 328 |
+
datetime.strptime(from_date, "%Y-%m-%d")
|
| 329 |
+
.astimezone(TIMEZONE)
|
| 330 |
+
.replace(hour=0, minute=0, second=0, microsecond=0)
|
| 331 |
)
|
| 332 |
from_timestamp = from_datetime.isoformat(timespec="microseconds")
|
| 333 |
to_timestamp = None
|