6

Extension of #8746 :

I have tried to set the precision in the config file as seconds. But as i write data and tries to fetch it its again showing Nanoseconds timestamp.

I read the whole Doc but couldn't figure it out only change in my config file is: precision = "s"

help me understand these things

How do I set the precision at DB level and how will I make sure I only get set precision timestamps in epoch. And I am using IST as timezone for my Application so also tell me how to set the same for InfluxDB in configuration

I am using python-influxdb client seriesHelper to write data into db and not specifying any time while writing data.

Edit: Added a pull request to resolve this in influxdb-python SeriesHelper Class - #502

Appunni M
  • 83
  • 3
  • 9

1 Answers1

1

Set query parameter epoch=s. See docs.

Query parameters are already supported by influxdb-python, for example:

client = InfluxDBClient(<..>)
client.query(<..>, params={'epoch': 's'})
danny
  • 5,140
  • 1
  • 19
  • 31
  • I am using SeriesHelper class , and there was no option to set precision while writing. I added it and did a pull request into influxdb-python. I was doing that in order to improve query performance and avoid having to specify it everywhere. – Appunni M Sep 28 '17 at 16:32
  • When writing it would be `params={'precision': 's'}`, per docs. – danny Feb 07 '18 at 17:11