# Problem with Query UTC =0, apply -2h

**URL:** <https://community.grafana.com/t/problem-with-query-utc-0-apply-2h/125053>\
**Category:** Configuration\
**Tags:** templating\
**Created:** [June 28, 2024, 2:22pm UTC](https://community.grafana.com/t/problem-with-query-utc-0-apply-2h/125053 "2024-06-28T14:22:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SunrakuBzh](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@SunrakuBzh](https://community.grafana.com/u/SunrakuBzh)\
**Post date:** [June 28, 2024, 2:22pm UTC](https://community.grafana.com/t/problem-with-query-utc-0-apply-2h/125053/1 "2024-06-28T14:22:00Z")

</div>

Hello,

I would like to display data but grafana apply -2h on my query, I don’t understand what parameters I have to set to get the correct time and get no modification from grafana between what I store and what I display

I set UTC to +0 on dashboard and profil of grafana instead of +2 UTC but nothing change, in the query details I see that it stop 2h before the real ‘now’

 ![bad request grafana](https://us1.discourse-cdn.com/grafana/original/3X/e/e/eeb6ad44418f33a316a4bd2b28a760f9e71e3e78.png)

I did take a look to this topic : [Problem when using grafana with timezone UTC+2h - #6 by pooh](https://community.grafana.com/t/problem-when-using-grafana-with-timezone-utc-2h/47502/6)  
But I don’t understand the solution, what I have to do ?

![utc 0](https://us1.discourse-cdn.com/grafana/original/3X/d/1/d1f3026ce0315050574d4fd9a5bbd04456ee0a53.png)

 ![param grafana](https://us1.discourse-cdn.com/grafana/original/3X/5/e/5e307340a9e5dfadc2f2b497d67f5c9c62db428f.png)

My Sql timestamp are correct

 ![postgresql ok](https://us1.discourse-cdn.com/grafana/original/3X/0/c/0cef258f8167ba4fc2b8df73c0aaffcd314d8122.png)

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [June 28, 2024, 2:40pm UTC](https://community.grafana.com/t/problem-with-query-utc-0-apply-2h/125053/2 "2024-06-28T14:40:45Z")

</div>

your `STATE_START` column needs to be in UTC or converted to UTC using a function.

What data source is it? mysql, postgres, mssql?

---

<div class="post-metadata">

**Author:** ![SunrakuBzh](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@SunrakuBzh](https://community.grafana.com/u/SunrakuBzh)\
**Post date:** [July 1, 2024, 6:35am UTC](https://community.grafana.com/t/problem-with-query-utc-0-apply-2h/125053/3 "2024-07-01T06:35:38Z")

</div>

Hello,  
This is a PostgreSQL database, I made the query SELECT now() and it was at UTC+0 so I try to set to Europe/Paris in postgresql.conf…

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/d/a/da2548cd1154432bbbf98c413323376fc495118f.png)

after restart of database, the query Select now() give me the right time

 ![query ok](https://us1.discourse-cdn.com/grafana/original/3X/e/3/e3822292cf5e476f4e5c00b4b4d5b6c8c575b2fe.png)

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [July 1, 2024, 8:03am UTC](https://community.grafana.com/t/problem-with-query-utc-0-apply-2h/125053/5 "2024-07-01T08:03:11Z")

</div>

`NOW()` returns timestamp WITH TIME ZONE, but your tables has WITHOUT TIME ZONE:  
 ![image](https://us1.discourse-cdn.com/grafana/original/3X/9/4/9478f326ad6bf88cc1593180ec79d4c9edcd8c5c.png)

I’m happy to meet you with you today and help you with your problem on 2024-07-01 15:00:00 (please note it’s WITHOUT TIME ZONE :-P). I guarantee that we won’t meet, because this is not enough.  
My “2024-07-01 15:00:00” is in different time `2024-07-01 14:00:00+00` (I’m BST time zone),  
then yours “2024-07-01 15:00:00” - `2024-07-01 15:00:00+00` (I guess you are CEST time zone).

So use time WITH TIME ZONE in your table.

---

<div class="post-metadata">

**Author:** ![SunrakuBzh](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@SunrakuBzh](https://community.grafana.com/u/SunrakuBzh)\
**Post date:** [July 1, 2024, 8:58am UTC](https://community.grafana.com/t/problem-with-query-utc-0-apply-2h/125053/6 "2024-07-01T08:58:50Z")

</div>

Ok my now() on postgresql is good, on grafana it shows value correctly , and on nodered I insert date as utc+0 and it is working properly

Thanks for your help 👍
