# Timezone in \_sql query

**URL:** <https://discuss.elastic.co/t/timezone-in-sql-query/220358>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-sql\
**Created:** [February 21, 2020, 12:41pm UTC](https://discuss.elastic.co/t/timezone-in-sql-query/220358 "2020-02-21T12:41:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![valerica\_georgescu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valerica_georgescu/32/63105_2.png) [@valerica\_georgescu](https://discuss.elastic.co/u/valerica_georgescu)\
**Post date:** [February 21, 2020, 12:41pm UTC](https://discuss.elastic.co/t/timezone-in-sql-query/220358/1 "2020-02-21T12:41:50Z")

</div>

Hi I use in my etl the \_sql function to select some data from elastic. One simple example:  
_POST \_sql?format=txt  
{  
"query": "select max("@timestamp"),monitor.id, monitor.ip, monitor.status from "heartbeat_" where "@timestamp" \> now() - interval 10 minutes group by monitor.id, monitor.ip, monitor.status "  
}\*

The problem is that the @timestamp and other date fields are in UTC timezone, how can i specific in what timezone i want the result to be and what timezone is my date from where?

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [February 22, 2020, 2:29am UTC](https://discuss.elastic.co/t/timezone-in-sql-query/220358/2 "2020-02-22T02:29:35Z")

</div>

Hi @valerica_georgescu - Welcome to our community forums!

You may want to use the `time_zone` [parameter](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/sql-rest-fields.html) and check if that addresses your requirements.

I hope that helps.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 21, 2020, 2:29am UTC](https://discuss.elastic.co/t/timezone-in-sql-query/220358/3 "2020-03-21T02:29:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
