# Changing the timezone does not change how far the logs are from the current time

**URL:** <https://discuss.elastic.co/t/changing-the-timezone-does-not-change-how-far-the-logs-are-from-the-current-time/319753>\
**Category:** Kibana\
**Created:** [November 24, 2022, 12:28pm UTC](https://discuss.elastic.co/t/changing-the-timezone-does-not-change-how-far-the-logs-are-from-the-current-time/319753 "2022-11-24T12:28:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hemabh\_Ravee\_Fox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hemabh_ravee_fox/32/111494_2.png) [@Hemabh\_Ravee\_Fox](https://discuss.elastic.co/u/Hemabh_Ravee_Fox)\
**Post date:** [November 24, 2022, 12:28pm UTC](https://discuss.elastic.co/t/changing-the-timezone-does-not-change-how-far-the-logs-are-from-the-current-time/319753/1 "2022-11-24T12:28:58Z")

</div>

I am using a locally deployed elasticsearch and kibana. When I send data to an index with the current timestamp - in kibana it is displayed as being 5:30 hours ahead of the current time.

I came to understand that this is because my current timezone is GMT+5:30. So since the logs are being sent 5:30 hours ahead of time, that would imply that I am already on GMT right? But that is not the case. My current time in kibana is the actual time in my area, which on further searching I realised is being fetched from the browser.

I found the default timezone setting in kibana(via kibana-\>management-\>advanced settings), but when I change the default timezone in kibana to GMT (from the default value of browser), then my current time changes to GMT, but the logs that were 5:30 hours ahead of the current time are still 5:30 hours ahead of the current time. It's just that both the times have had 5:30 hours deducted from them. This is the view that makes sense, that the data is 5:30 hours ahead of GMT. But why does it stay ahead of me when timezone is set to browser even though my browser is on the right timezone (GMT+5:30)

---

<div class="post-metadata">

**Author:** ![Dzmitry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dzmitry/32/65026_2.png) [@Dzmitry](https://discuss.elastic.co/u/Dzmitry)\
**Post date:** [November 25, 2022, 4:38pm UTC](https://discuss.elastic.co/t/changing-the-timezone-does-not-change-how-far-the-logs-are-from-the-current-time/319753/2 "2022-11-25T16:38:03Z")

</div>

Hey @Hemabh_Ravee_Fox

Internally Elasticsearch converted dates to UTC (if the time-zone is specified)

> **[Date field type | Elasticsearch Guide \[8.5\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html)**

I think you should try setting timezone in Kibana to UTC as well. Let me know if that fixes the issue.

Regards, Dima

---

<div class="post-metadata">

**Author:** ![Hemabh\_Ravee\_Fox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hemabh_ravee_fox/32/111494_2.png) [@Hemabh\_Ravee\_Fox](https://discuss.elastic.co/u/Hemabh_Ravee_Fox)\
**Post date:** [November 28, 2022, 8:26am UTC](https://discuss.elastic.co/t/changing-the-timezone-does-not-change-how-far-the-logs-are-from-the-current-time/319753/3 "2022-11-28T08:26:52Z")

</div>

I changed the timezone to UTC but it had no effect whatsoever. It seems to be the same as GMT. Any new data I add to an index is still 05:30 hours ahead of me and stays that way no matter which timezone I select.

here is the timestamp I'm sending in the data, maybe I need to change it's format?  
`'timestamp': '2022-11-28T13:49:42.077248'`

---

<div class="post-metadata">

**Author:** ![Dzmitry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dzmitry/32/65026_2.png) [@Dzmitry](https://discuss.elastic.co/u/Dzmitry)\
**Post date:** [November 28, 2022, 10:19am UTC](https://discuss.elastic.co/t/changing-the-timezone-does-not-change-how-far-the-logs-are-from-the-current-time/319753/4 "2022-11-28T10:19:32Z")

</div>

You probably need to update your mappings for the index so that ES can recognise the date properly or change timestamp format to the one of default ones:  
You can read more here:

> **[format | Elasticsearch Guide \[8.5\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html)**

Regards, Dima

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [November 28, 2022, 1:04pm UTC](https://discuss.elastic.co/t/changing-the-timezone-does-not-change-how-far-the-logs-are-from-the-current-time/319753/5 "2022-11-28T13:04:08Z")

</div>

Changing the timezone in Kibana won't fix the issue and will probably make everything harder for the people who needs to use Kibana.

You should let Kibana get the timezone from the browser, which is the default.

Your issue is probably related on how you are indexing your data and how your date string looks like, you need to provide more context about it.

For example, this date you shared:

```auto
'timestamp': '2022-11-28T13:49:42.077248'

```

Is it your local time? Is it in UTC? How are you ingesting your data? Elasticsearch stores all the date strings in UTC, if your date string has a time offset, but this is not explicit in the date string, elasticsearch will assume it is in UTC and this may leads to issues like yours.

If this date, `2022-11-28T13:49:42.077248` is in your local time, which has a 05:30 offset in UTC, and you are not passing any information about this offset to elasticsearch, it will be ingested as it is in UTC, when you see this document in Kibana it will add another 05:30 offset.

So the first thing is, how are you indexing your data, and in which timezone is your data?

---

<div class="post-metadata">

**Author:** ![Hemabh\_Ravee\_Fox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hemabh_ravee_fox/32/111494_2.png) [@Hemabh\_Ravee\_Fox](https://discuss.elastic.co/u/Hemabh_Ravee_Fox)\
**Post date:** [November 30, 2022, 8:51am UTC](https://discuss.elastic.co/t/changing-the-timezone-does-not-change-how-far-the-logs-are-from-the-current-time/319753/6 "2022-11-30T08:51:28Z")

</div>

I was only adding a 'Z' at the end of the time format, as I thought is the case for ISO format. I removed the 'Z' and appended '+05:30' before indexing it and that has solved the problem for me. Thanks a lot!  
Also adding this [resource](https://discuss.elastic.co/t/how-to-specify-timezone-on-elasticsearch/259614/4) which helped me with the right format to use

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [November 30, 2022, 3:41pm UTC](https://discuss.elastic.co/t/changing-the-timezone-does-not-change-how-far-the-logs-are-from-the-current-time/319753/7 "2022-11-30T15:41:55Z")

</div>

> [@Hemabh\_Ravee\_Fox](#):
>
> I was only adding a 'Z' at the end of the time format, as I thought is the case for ISO format.

The `Z` means `UTC`, to add a offset you use `-/+00:00`, in your case the `+05:30`.

---

<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:** [December 28, 2022, 3:42pm UTC](https://discuss.elastic.co/t/changing-the-timezone-does-not-change-how-far-the-logs-are-from-the-current-time/319753/8 "2022-12-28T15:42:24Z")

</div>

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