fix: 日志显示时间也转换为UTC+8
This commit is contained in:
parent
7ad77f60c7
commit
8331a2e7ba
@ -893,9 +893,14 @@ class FreqaiPrimer(IStrategy):
|
||||
except:
|
||||
pass
|
||||
|
||||
# 获取时间字符串
|
||||
# 获取时间字符串(先转换为UTC+8再格式化)
|
||||
if isinstance(data_timestamp, datetime):
|
||||
data_time_str = data_timestamp.strftime('%H:%M:%S')
|
||||
# 转换为 UTC+8 用于显示
|
||||
display_timestamp = data_timestamp
|
||||
if display_timestamp.tzinfo is None:
|
||||
display_timestamp = display_timestamp.replace(tzinfo=timezone.utc)
|
||||
display_timestamp = display_timestamp.astimezone(UTC_PLUS_8)
|
||||
data_time_str = display_timestamp.strftime('%H:%M:%S')
|
||||
|
||||
# 计算数据延迟(只在 Live/Dryrun 模式下)
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user