Time series Data outside time range

Hi,
Could somebody help me with Time series graph. My query is this

SELECT 
    CONVERT_TZ(Laikas, @@SESSION.time_zone, '-04:00') AS time,
    CAST(stulpelis2 AS float) AS value
FROM
    asedlt_8622.testukas
ORDER BY
    Laikas DESC
LIMIT
    5;

then I run my query, get answer “Data outside time range”, I have attached picture. How solve this problem?

what is @@SESSION.time_zone in relation to UTC?
what timezone is Laikas


if I use this query

SELECT
    Laikas AS time,
    CAST(stulpelis2 AS float) AS value
FROM
    asedlt_8622.testukas
ORDER BY
    Laikas DESC
LIMIT
    5;

Grafana get data


But same query to my mysql get this data

You see different one hour. Why? :slight_smile:

because your Laikas column is 1 hour difference from UTC meaning your Laikas column is not UTC. What time zone are you in ?

What does @@SESSION.time_zone show

I am in the UTC/GMT +1 time zone, while the server is in the UTC/GMT +2 time zone

in that case try ie using of course your time zone
convert_tz(Laikas,'America/New_York','UTC') as time

CET Central Europe Time
MET Middle European Time

no :slight_smile: show next day time :smiley: I left this CONVERT_TZ(Laikas, @@SESSION.time_zone, ‘-04:00’) AS time it working now.

1 Like