# @timestamp is 4 hours behind when i change timezone in advance setting kibana and database date field is ok

**URL:** https://discuss.elastic.co/t/timestamp-is-4-hours-behind-when-i-change-timezone-in-advance-setting-kibana-and-database-date-field-is-ok/351107
**Category:** Logstash
**Tags:** elastic-stack-alerting
**Created:** [January 15, 2024, 7:56pm UTC](https://discuss.elastic.co/t/timestamp-is-4-hours-behind-when-i-change-timezone-in-advance-setting-kibana-and-database-date-field-is-ok/351107 "2024-01-15T19:56:12Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Aslam\_Ansari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aslam_ansari/32/62383_2.png) [@Aslam\_Ansari](https://discuss.elastic.co/u/Aslam_Ansari)
#### Post date: [January 15, 2024, 7:56pm UTC](https://discuss.elastic.co/t/timestamp-is-4-hours-behind-when-i-change-timezone-in-advance-setting-kibana-and-database-date-field-is-ok/351107/1 "2024-01-15T19:56:12Z")

</div>

@timestamp is 4 hours behind when I change the timezone as UTC in Kibana's advance settings and the database date field is correct. However, when I set the timezone as browser advance settings in Kibana, @timestamp is correct, but the database date field displays as 4 hours ago. please suggest me how fix this issue am using elk 8.3.0

---

<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: [January 15, 2024, 11:15pm UTC](https://discuss.elastic.co/t/timestamp-is-4-hours-behind-when-i-change-timezone-in-advance-setting-kibana-and-database-date-field-is-ok/351107/2 "2024-01-15T23:15:06Z")

</div>

Hello,

Please share some evidence of what you are seeing, like some Kibana screenshots showing the time difference.

Also, in which timezone are you in? in which timezone are your logs being generated? How are you parsing your logs? Share your logstash configuration.

What you described is a common issue, it happens when you have logs that are not on UTC and do not have any information about the timezone in which they were generated, in this case you need to inform logstash durange the parsing what is the timezone of the logs.

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [January 16, 2024, 12:31am UTC](https://discuss.elastic.co/t/timestamp-is-4-hours-behind-when-i-change-timezone-in-advance-setting-kibana-and-database-date-field-is-ok/351107/3 "2024-01-16T00:31:18Z")

</div>

@Aslam_Ansari

There are three concepts with respect to dates that core to how elastic manages dates/ time stamps

1. All dates are stored as UTC in elasticsearch. If the timezone is defined as part of the incoming date/timestamp it will be converted to UTC and stored as UTC.

2. If an incoming date / timestamp does not have a time zone associated with it, the timezone is assumed to be UTC when stored. This can be a source of mismatched time stamps / confusion.

3. dates and timestamps are displayed within Kibana based on the time zone of the browser not the timezone of the incoming source.

Once you understand these three critical concepts, hopefully that will help you understand what you're seeing.

---

<div class="post-metadata">

### Author: ![Aslam\_Ansari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aslam_ansari/32/62383_2.png) [@Aslam\_Ansari](https://discuss.elastic.co/u/Aslam_Ansari)
#### Post date: [January 16, 2024, 6:36am UTC](https://discuss.elastic.co/t/timestamp-is-4-hours-behind-when-i-change-timezone-in-advance-setting-kibana-and-database-date-field-is-ok/351107/4 "2024-01-16T06:36:05Z")

</div>

@leandrojmp Thanks for your support As we can see in snap ,when i am selecting browser as time zone my time zone is Asia/Dubai

 ![kibantimeissue](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1a984ea372050ef569367c0b19d25e1076199d4c.png)

---

<div class="post-metadata">

### Author: ![Aslam\_Ansari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aslam_ansari/32/62383_2.png) [@Aslam\_Ansari](https://discuss.elastic.co/u/Aslam_Ansari)
#### Post date: [January 16, 2024, 6:53am UTC](https://discuss.elastic.co/t/timestamp-is-4-hours-behind-when-i-change-timezone-in-advance-setting-kibana-and-database-date-field-is-ok/351107/5 "2024-01-16T06:53:06Z")

</div>

@stephenb Thank you very much for the nice explanation. This means that the date coming from the database needs to be converted to UTC format. In my case, `end_date` is retrieved from the database.

---

<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: [January 16, 2024, 11:55am UTC](https://discuss.elastic.co/t/timestamp-is-4-hours-behind-when-i-change-timezone-in-advance-setting-kibana-and-database-date-field-is-ok/351107/6 "2024-01-16T11:55:41Z")

</div>

This is not just a timezone issue, the dates are completely different, it seems that you are not using the date from your logs to be the date of your elasticsearch document.

You didn't share your Logstash configuration as asked, you need to share this to give more insights of what you are doing.

Also, in what timezone is your db date? You didn't answer this as well.

---

<div class="post-metadata">

### Author: ![Aslam\_Ansari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aslam_ansari/32/62383_2.png) [@Aslam\_Ansari](https://discuss.elastic.co/u/Aslam_Ansari)
#### Post date: [January 18, 2024, 8:11am UTC](https://discuss.elastic.co/t/timestamp-is-4-hours-behind-when-i-change-timezone-in-advance-setting-kibana-and-database-date-field-is-ok/351107/7 "2024-01-18T08:11:55Z")

</div>

Thank you very much for your assistance. The issue has been resolved; I changed the date format to `TO_CHAR(end_date, 'MM-DD-YYYY HH:mm:ss')` for the `end_date` in the select query. Now, both `@timestamp` and `end_date` are in sync.

---

<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: [February 15, 2024, 8:12am UTC](https://discuss.elastic.co/t/timestamp-is-4-hours-behind-when-i-change-timezone-in-advance-setting-kibana-and-database-date-field-is-ok/351107/8 "2024-02-15T08:12:00Z")

</div>

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