# Convert Epoch time to "yyyy/MM/dd HH:mm:ss.SSS"

**URL:** <https://discuss.elastic.co/t/convert-epoch-time-to-yyyy-mm-dd-hhss-sss/160912>\
**Category:** Logstash\
**Created:** [December 14, 2018, 1:38pm UTC](https://discuss.elastic.co/t/convert-epoch-time-to-yyyy-mm-dd-hhss-sss/160912 "2018-12-14T13:38:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![emailshak](https://avatars.discourse-cdn.com/v4/letter/e/ad7895/32.png) [@emailshak](https://discuss.elastic.co/u/emailshak)\
**Post date:** [December 14, 2018, 1:38pm UTC](https://discuss.elastic.co/t/convert-epoch-time-to-yyyy-mm-dd-hhss-sss/160912/1 "2018-12-14T13:38:42Z")

</div>

I am receiving epoch time as input and would like to persist this in the following format "yyyy/MM/dd HH:mm:ss.SSS" in Elasticsearch. I am performing the following at present in logstash

date {  
match =\> ["mydate", "UNIX\_MS"]  
target =\> "mydate"  
}

This persist's the date in the following format "2017-01-28T18:08:08.064Z" but i need the format to be "2017/01/28 18:08:08.064"

How do i change this format?

Appreciate your input! Thanks

---

<div class="post-metadata">

**Author:** ![bryan\_stuhlsatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bryan_stuhlsatz/32/49123_2.png) [@bryan\_stuhlsatz](https://discuss.elastic.co/u/bryan_stuhlsatz)\
**Post date:** [December 16, 2018, 8:42pm UTC](https://discuss.elastic.co/t/convert-epoch-time-to-yyyy-mm-dd-hhss-sss/160912/2 "2018-12-16T20:42:20Z")

</div>

what is being used to view the data? If you are using Kibana, you can configure kibana to view the data in all sorts of various time formats.

---

<div class="post-metadata">

**Author:** ![emailshak](https://avatars.discourse-cdn.com/v4/letter/e/ad7895/32.png) [@emailshak](https://discuss.elastic.co/u/emailshak)\
**Post date:** [December 20, 2018, 3:25am UTC](https://discuss.elastic.co/t/convert-epoch-time-to-yyyy-mm-dd-hhss-sss/160912/3 "2018-12-20T03:25:03Z")

</div>

i was using a specific format in my kibana mapping. Once i removed this format in kibana and only specified the datatype to be date, i was able to persist the data to elasticsearch using logstash. The date field saved in elasticsearch happens to be of the default type (UTC) .

---

<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:** [January 17, 2019, 3:25am UTC](https://discuss.elastic.co/t/convert-epoch-time-to-yyyy-mm-dd-hhss-sss/160912/4 "2019-01-17T03:25:08Z")

</div>

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