MySQL timezone conversion: interval Europe/Paris failed

Hello, for my panel i need to transform my time into an other time zone,

in previous panel i used

image

but in France UTC+2 became UTC+1 in december, so i cant just use UTC+2

I use a mysql datasource

i use the line under :

UNIX_TIMESTAMP(CONVERT_TZ(timestamp,‘Europe/Paris’, ‘UTC’)) * 1000 AS time,

image

But Grafana or sql don’t recognize ‘Europe/Paris’ interval

image

i already try with ’ with ` and with nothing before and after Europe/Paris

Is anyone know this issue and how i can fix that

Thanks you

The error interpolation failed: error parsing interval 'Europe/Paris' which most likely means your MySQL/MariaDB timezone tables are not loaded.

Check:

sql

SELECT COUNT(*) FROM mysql.time_zone_name WHERE Name = 'Europe/Paris';

Returns 1 → tables already loaded, share your full query for further help
Returns 0 → run Step 2

Load timezone tables:

bash

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

After loading, your original query will work correctly and Europe/Paris handles DST automatically → no need to hardcode UTC+2 or UTC+1.

its look like i have the table

But still the error

image

So here my query :

SELECT

UNIX_TIMESTAMP(CONVERT_TZ(timestamp, ‘Europe/Paris’, ‘UTC’)) * 1000 AS time,

SUM(V_temps_P1) AS P1,

SUM(V_temps_P2) AS P2

FROM

plcnext.opcua

WHERE

$__timeFilter(CONVERT_TZ(timestamp, ‘Europe/Paris’, ‘UTC’))

AND (

V_temps_P1 IS NOT NULL

OR V_temps_P2 IS NOT NULL

)

GROUP BY

$__timeGroup(

CONVERT_TZ(timestamp, 'Europe/Paris', 'UTC'),

'1h'

)

ORDER BY

$__timeGroup(

CONVERT_TZ(timestamp, 'Europe/Paris', 'UTC'),

'1h'

)

Since named time zones like Europe/Paris are supported by MySQL/MariaDB when the time zone tables are loaded, I’d try removing CONVERT_TZ() from the Grafana macros first and only use it in the SELECT clause:

SELECT
  UNIX_TIMESTAMP(CONVERT_TZ(timestamp, 'Europe/Paris', 'UTC')) * 1000 AS time,
  SUM(V_temps_P1) AS P1,
  SUM(V_temps_P2) AS P2
FROM plcnext.opcua
WHERE
  $__timeFilter(timestamp)
  AND (
    V_temps_P1 IS NOT NULL
    OR V_temps_P2 IS NOT NULL
  )
GROUP BY
  $__timeGroup(timestamp, '1h')
ORDER BY
  $__timeGroup(timestamp, '1h');

Could you also tell whether the timestamp column is stored in UTC or Europe/Paris local time?

It work

However i still have 2 problems

1st : I don’t see anymore the hours (left is with convert_tz +02:00 +00:00) (right is what you give me)

image

2nd value are not good anymore, the left one have the good value (i look in my DB) but the right one have other and incorect value