__timeFilter does not produce the correct time range in SQL

I have the same issue with Grafana:

  • Server, sensors and browser are in German timezone
  • datatype in MySQL is DATETIME
  • Time is logged in UTC by sensors
  • As expected the actual time is converted correct to the local timezone
  • When using macro “$__timeFilter(column)” data is missing

To fix the issue I use this filter:
timeUTC BETWEEN convert_TZ($__timeFrom(),@@SESSION.time_zone,'+00:00') and convert_TZ($__timeTo(),@@SESSION.time_zone,'+00:00')

In my opinion the timezone conversion is missing in the macro “$__timeFilter(column)”.

1 Like