Search code examples
influxdb

influxdb date format when entering/displaying data


I wrote a python program to enter historical data into influxdb.

Everything seems to be ok, but I am not sure if the time field is incorrect. The time is supposed to be YYYY,MM,DD,HH,MM as integers.

This is an example of the json that I am sending to 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'}]

However, when I query the data, I get a strange number for the time like this:

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

Seems like either the json time format is wrong, or the number displayed by the query is an encoded date representation?


Solution

  • I found the answer here

    Formatting the output by entering the following command in the CLI:

    precision rfc3339