# Date formatting yyyy.MM.dd

**URL:** <https://discuss.elastic.co/t/date-formatting-yyyy-mm-dd/251588>\
**Category:** Elasticsearch\
**Created:** [October 9, 2020, 3:26pm UTC](https://discuss.elastic.co/t/date-formatting-yyyy-mm-dd/251588 "2020-10-09T15:26:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![VeeT](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@VeeT](https://discuss.elastic.co/u/VeeT)\
**Post date:** [October 9, 2020, 3:26pm UTC](https://discuss.elastic.co/t/date-formatting-yyyy-mm-dd/251588/1 "2020-10-09T15:26:35Z")

</div>

I have a Date input in yyyy.MM.dd format but is getting converted to yyyy.MM.dd HH:mm:ss.ZZZ with the time getting set to "20:00:00.000".

For example, the Date in put is "2020.10.09" but it's getting displayed in Kibana as "Oct 8, 2020 @ 20:00:00.000".

I have the following index mapping for Date:  
"Date" : {  
"type" : "date",  
"ignore\_malformed" : false,  
"format" : "yyyy.MM.dd||strict\_date\_optional\_time||epoch\_millis"  
},

We are using ELK 7.6.

How do I keep the date as yyyy.MM.dd in Elasticsearch?

Thanks!  
Vee

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [October 9, 2020, 4:22pm UTC](https://discuss.elastic.co/t/date-formatting-yyyy-mm-dd/251588/2 "2020-10-09T16:22:50Z")

</div>

Not sure where you are seeing the date or how you are looking to use it, but try adjusting the advanced settings and if that gives you what you are looking for.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/5/95ce1c88e0842cc1068be20ae52bb70e7194359e.png)

---

<div class="post-metadata">

**Author:** ![VeeT](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@VeeT](https://discuss.elastic.co/u/VeeT)\
**Post date:** [October 9, 2020, 5:16pm UTC](https://discuss.elastic.co/t/date-formatting-yyyy-mm-dd/251588/3 "2020-10-09T17:16:16Z")

</div>

Hi Aaron,  
The conversion is happening in Elasticsearch, but I'm viewing in Kibana.

This is the input Date that was sent to Logstash:

 ![InputDate](https://us1.discourse-cdn.com/elastic/original/3X/4/4/4439beef1558a42111a0d25ce0e9969b19395fac.png)

This is the output Date that was parsed to display in Kibana:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/1/31c890f2d4f79842ed4a5f29625f94e13a80fec9.png)

The goal is to either display Oct 9, 2020 or Oct 9, 2020 00:00:00.000 since there was no time sent as input.

Thanks!  
Vee

---

<div class="post-metadata">

**Author:** ![amorrow](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@amorrow](https://discuss.elastic.co/u/amorrow)\
**Post date:** [October 9, 2020, 7:26pm UTC](https://discuss.elastic.co/t/date-formatting-yyyy-mm-dd/251588/4 "2020-10-09T19:26:12Z")

</div>

My guess is the date field in the Elasticsearch entry is 2020.10.09 00:00:00.000 UTC. Kibana uses the timezone of your browser to convert the UTC time to your local time. 2020.10.09 00:00:00.000 UTC is 20:00:00 in Easter Daylight time.

Pipelines can set the timezeone for a date field during ingestion. Check out the examples at [https://www.elastic.co/guide/en/elasticsearch/reference/current/date-processor.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/date-processor.html). When processed the UTC timestamp is offset based on the selected timezone.

---

<div class="post-metadata">

**Author:** ![VeeT](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@VeeT](https://discuss.elastic.co/u/VeeT)\
**Post date:** [October 13, 2020, 4:48pm UTC](https://discuss.elastic.co/t/date-formatting-yyyy-mm-dd/251588/5 "2020-10-13T16:48:12Z")

</div>

Thanks Tony.

Do you know if it's possible to just get the date as an input without the timestamp?

---

<div class="post-metadata">

**Author:** ![amorrow](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@amorrow](https://discuss.elastic.co/u/amorrow)\
**Post date:** [October 13, 2020, 5:53pm UTC](https://discuss.elastic.co/t/date-formatting-yyyy-mm-dd/251588/6 "2020-10-13T17:53:53Z")

</div>

I do not. I've only worked with logs that contain date-time values. How are you taking your event and breaking it apart to get the date field? Both Logstash and Beats can be used to add a timezone to a date from the event. Maybe you can it there.  
Logstash: [https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html#plugins-filters-date-timezone](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html#plugins-filters-date-timezone)  
example:

```auto
filter {
    date {
        timezone => "America/New_York"
        match => ["date", "yyyy.MM.dd"]
    }
}

```

Filebeat: [https://www.elastic.co/guide/en/beats/filebeat/current/add-locale.html](https://www.elastic.co/guide/en/beats/filebeat/current/add-locale.html)

---

<div class="post-metadata">

**Author:** ![VeeT](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@VeeT](https://discuss.elastic.co/u/VeeT)\
**Post date:** [October 16, 2020, 3:26pm UTC](https://discuss.elastic.co/t/date-formatting-yyyy-mm-dd/251588/7 "2020-10-16T15:26:27Z")

</div>

Thanks Tony. The data is sent to us with a format of yyyy.MM.dd.

---

<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:** [November 13, 2020, 3:26pm UTC](https://discuss.elastic.co/t/date-formatting-yyyy-mm-dd/251588/8 "2020-11-13T15:26:32Z")

</div>

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