Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Timestamps slightly different in Influxdb #344

Closed
@hirochri

Description

@hirochri

Occasionally my data arrives in the database with timestamps that are ever so slightly ahead or behind the time they actually should be, and I have been having trouble tracking down where this behavior is coming from!

I am using a pandas dataframe with a datetime index, which is being written to the database using write_points (No specified time precision). The timestamps within the dataframe are numpy datetime64[ns]'s and Influx's default time precision is also nanoseconds iirc. What often happens though is that the timestamps in the database are slightly different and looks like it possibly has to do with floats? (My problem is similar to this, as queries based on time now miss 1 or 2 data points)

For instance, this is how the following timestamps change:

datetime64[ns] --> unix timestamp in Influxdb
2016-06-20 13:35:42.270000 --> 1466429742270000128
2016-06-20 14:02:49.770000 --> 1466431369769999872

If anyone could clarify why this behavior is happening or point me in the right direction of how to fix it, that would be greatly appreciated, thanks!

Edit: After glancing at the other possible issues, it may very well be related to Issue 340

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions