输入/显示数据时的流入日期格式

时间:2017-09-29 06:10:50

标签: influxdb

我写了一个python程序,将历史数据输入到Influxdb。

一切似乎都没问题,但我不确定时间字段是否不正确。时间应该是YYYY,MM,DD,HH,MM作为整数。

这是我发送给json

influxdb示例
[{'fields': {'High': 72.06, 'Close': 72.01, 'Volume': 6348, 'Open': 72.01, 'Low': 72.01}, 'tags': {'country': 'US', 'symbol': 'AAXJ', 'type': 'ETF', 'exchange': 'NASDAQ'}, 'time': datetime.dat
e(2017, 9, 7, 15, 35), 'measurement': 'quote'}]

然而,当我查询数据时,我得到一个奇怪的数字,如下:

time                Close    High    Low      Open   Volume country exchange symbol type
----                -----    ----    ---      ----   ------ ------- -------- ------ ----
1504798500000000000 144.46   144.47  144.06   144.1  112200 US      NYSE     IBM    STOCK

好像json时间格式错误,或者查询显示的数字是编码日期表示?

1 个答案:

答案 0 :(得分:0)

我找到了答案here

通过在CLI中输入以下命令来格式化输出:

precision rfc3339