Skip to content

Incorrect calculation of Microseconds timestamp #133

Closed
@amonin7

Description

@amonin7

Right now, the conversion from influxdb::query::Timestamp::Microseconds to chrono::Datetime is incorrect:

            Timestamp::Microseconds(mis) => {
                let nanos = mis / 10000;
                Utc.timestamp_nanos(nanos.try_into().unwrap())
            }

In this case, nanos should be calculated by multiplying mis by MICROS_PER_NANO, which equals 1000.

p.s. If I understand correctly, this bug affects the correctness of timestamps stored in the influxdb and, therefore, if one uses microseconds precision to store the data - the time of the data in the database would be incorrect.

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