<ul>
<item v-for='cat in categories' :category='cat'></item>
</ul>
错误:import pandas as pd
import datetime
def open_csv(path):
try:
df = pd.read_csv(path)
return df
except FileNotFoundError:
print("ERR: FileNotFoundError", path)
data = open_csv("historical/BNBBTC")
for d in data["Open_time"]:
print(d)
print(type(d))
print(datetime.datetime.fromtimestamp(d).strftime('%Y-%m-%d %H:%M:%S'))
我不明白是什么问题?如果b = int(“ 1514764800000”),那么一切正常!
答案 0 :(得分:0)
import time
并将datetime.datetime.fromtimestamp(d).strftime('%Y-%m-%d %H:%M:%S')
替换为time.strftime('%Y-%m-%d %H:%M:%S')
答案 1 :(得分:0)
有点晚了,但您遇到的问题是时间戳以毫秒为单位,请像这样转换:
milliSeconds = timestamp % 1000
timestamp = timestamp / 1000
converted = datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d %H:%M:%S') + f".{milliSeconds}"