# Change in Time In elasticsearch and Database

**URL:** https://discuss.elastic.co/t/change-in-time-in-elasticsearch-and-database/338869
**Category:** Elasticsearch
**Tags:** kql-kibana-query-language
**Created:** [July 20, 2023, 9:57am UTC](https://discuss.elastic.co/t/change-in-time-in-elasticsearch-and-database/338869 "2023-07-20T09:57:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![UshasMerrinGeorge](https://avatars.discourse-cdn.com/v4/letter/u/e19b73/32.png) [@UshasMerrinGeorge](https://discuss.elastic.co/u/UshasMerrinGeorge)
#### Post date: [July 20, 2023, 9:57am UTC](https://discuss.elastic.co/t/change-in-time-in-elasticsearch-and-database/338869/1 "2023-07-20T09:57:52Z")

</div>

Hi all,

I'm having trouble with data parsing from a database to Elasticsearch.  
The "downloaddate" field in the database has a value like "2023-07-12 17:30:17.000."

When I print it in the terminal using stdout, it's correct.

However, when indexed in Elasticsearch, the time changes to (Jul 12, 2023 @ 23:00:17.000).

 ![Screenshot 2023-07-20 at 3.27.00 PM](https://us1.discourse-cdn.com/elastic/original/3X/8/b/8bc9d1bde0838d781c3092d16f4569a0bb5d771e.png)

I tried using a date filter, but the issue remains unresolved.

I'd appreciate any suggestions or help in resolving this time difference problem.

Thank you!

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [July 20, 2023, 10:08am UTC](https://discuss.elastic.co/t/change-in-time-in-elasticsearch-and-database/338869/2 "2023-07-20T10:08:32Z")

</div>

All timestamps in Elasticsearch are in UTC timezone. Kibana do translate the default timestamp to the local timezone when displaying it, which likely is what you are seeing.

---

<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: [July 20, 2023, 12:43pm UTC](https://discuss.elastic.co/t/change-in-time-in-elasticsearch-and-database/338869/3 "2023-07-20T12:43:51Z")

</div>

> [@UshasMerrinGeorge](#):
>
> I tried using a date filter, but the issue remains unresolved.
> 
> I'd appreciate any suggestions or help in resolving this time difference problem.

As already mentioned all dates in Elasticsearch are stored in UTC and Kibana will convert this UTC date to your local timezone.

The issue here is that your date string does not have any information about the timezone, so Logstash will consider that this date is already in UTC, this is what you get in your stdout output.

The **Z** in the end of the date means that it is in UTC.

If your date `2023-07-12 17:30:17.000` **is not** in UTC, but in your local time zone, you need to inform this to logstash in the date filter using the `timezone` option.

Since Kibana is showing 17:30:17 UTC as 23:00:17 in your local timezone, you are in a UTC+5:30 timezone, so you need to inform that to Logstash.

You can do that adding the canonical name of your timezone, something like `Asia/Kolkata` which is UTC+5:30, or you can use the numerical offset directly as `+0530`, but the canonical name is recommended as it will also applies DST changes if it exists.

Use the canonical name or the numeric offset, do not use the abbreviated timezone names like `IST` as this can not work as expected.

---

<div class="post-metadata">

### Author: ![UshasMerrinGeorge](https://avatars.discourse-cdn.com/v4/letter/u/e19b73/32.png) [@UshasMerrinGeorge](https://discuss.elastic.co/u/UshasMerrinGeorge)
#### Post date: [July 21, 2023, 8:01am UTC](https://discuss.elastic.co/t/change-in-time-in-elasticsearch-and-database/338869/4 "2023-07-21T08:01:04Z")

</div>

When I parse the data to my local Elasticsearch instance, there is no difference in time. However, when I parse it to Elasticsearch in azure VM, that time difference occurs.

---

<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: [August 18, 2023, 8:01am UTC](https://discuss.elastic.co/t/change-in-time-in-elasticsearch-and-database/338869/5 "2023-08-18T08:01:51Z")

</div>

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