# Register a custom date formatter used like build-in ones

**URL:** <https://discuss.elastic.co/t/register-a-custom-date-formatter-used-like-build-in-ones/26375>\
**Category:** Elasticsearch\
**Created:** [July 28, 2015, 12:07am UTC](https://discuss.elastic.co/t/register-a-custom-date-formatter-used-like-build-in-ones/26375 "2015-07-28T00:07:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cheng](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@Cheng](https://discuss.elastic.co/u/Cheng)\
**Post date:** [July 28, 2015, 12:07am UTC](https://discuss.elastic.co/t/register-a-custom-date-formatter-used-like-build-in-ones/26375/1 "2015-07-28T00:07:21Z")

</div>

Hi All,

In my index, I used a certain date format, for example - "format" : "yyyy-MM-dd HH:mm:ss.SSS", in multiple locations of field definitions in my type mappings. As this date format does not match any build-in ones, i just wonder if i can register such date formatter as something like mydate\_time. And then use it like this - "format" : "mydate\_time", in field definitions, so that i don't have to copy this long string - "yyyy-MM-dd HH:mm:ss.SSS", in many places, which also allows a better maintainability.

Thanks,  
Cheng

---

<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:** [July 5, 2017, 11:58pm UTC](https://discuss.elastic.co/t/register-a-custom-date-formatter-used-like-build-in-ones/26375/2 "2017-07-05T23:58:46Z")

</div>

Closed on July 5, 2017, 11:58pm UTC


