Skip to content

$from Documentation is Incorrect #115

Closed

Description

@PeterZaitsev

"Help" Says the following:

$from - replaced with timestamp/1000 value of selected "Time Range:From"

While I see $from in my case as UnixTimestamp value of the start date with no division:

SELECT toDate(1393289997)

┌─toDate(1393289997)─┐
│ 2014-02-25 │
└────────────────────┘

1 rows in set. Elapsed: 0.001 sec.

Activity

  1. Slach commented on Jul 3, 2020

    @Slach
    Collaborator

    @PeterZaitsev there is not a bug, there is a misunderstanding between documentation and interpretation of term "timestamp"

    timestamp in Grafana JavaScript it's a UnixTime + ms momentjs

    please look at
    https://github.com/Vertamedia/clickhouse-grafana/blob/master/src/sql_query.ts#L475
    https://github.com/Vertamedia/clickhouse-grafana/blob/master/src/datasource.ts#L138

    dateMatch.parse convert string to momentjs.com DateTime format which contains microseconds "2013-02-08 24:00:00.000"
    so, I will change documentation for more clear

  2. added 2 commits that reference this issue on Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions