# How to change the default date format?

**URL:** https://discuss.elastic.co/t/how-to-change-the-default-date-format/2886
**Category:** Elasticsearch
**Created:** [April 2, 2010, 7:25pm UTC](https://discuss.elastic.co/t/how-to-change-the-default-date-format/2886 "2010-04-02T19:25:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![HubertChang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hubertchang/32/3352_2.png) [@HubertChang](https://discuss.elastic.co/u/HubertChang)
#### Post date: [April 2, 2010, 7:25pm UTC](https://discuss.elastic.co/t/how-to-change-the-default-date-format/2886/1 "2010-04-02T19:25:04Z")

</div>

Now date format can be specified by mapping for specified type. Documents said "The parsing of dates uses Joda. The default date parsing used if no format is specified is ISODateTimeFormat.dateOptionalTimeParser.".

How to change the default date format globally, not type specified?

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [April 2, 2010, 9:07pm UTC](https://discuss.elastic.co/t/how-to-change-the-default-date-format/2886/2 "2010-04-02T21:07:23Z")

</div>

If you refer to automatically identifying strings as dates, and which format  
to use, then, on a per type basis, you can use the dateFormats option,  
explained here:  
[http://www.elasticsearch.com/docs/elasticsearch/mapping/object\_type/#dateFormats](http://www.elasticsearch.com/docs/elasticsearch/mapping/object_type/#dateFormats).  
This, of course, can be applied on the root level object mapping (  
[http://www.elasticsearch.com/docs/elasticsearch/mapping/root\_object\_type/](http://www.elasticsearch.com/docs/elasticsearch/mapping/root_object_type/)).

If you want to change the format of dates for types that are automatically  
introduced, then you can change the dynamic mappings explained here:  
[http://www.elasticsearch.com/docs/elasticsearch/mapping/dynamic\_mapping/](http://www.elasticsearch.com/docs/elasticsearch/mapping/dynamic_mapping/). I  
have just added this section to the mapping area (it used to be documented  
under the mapper module).

-shay.banon

On Fri, Apr 2, 2010 at 10:25 PM, HubertChang [huixiu@gmail.com](mailto:huixiu@gmail.com) wrote:

> Now date format can be specified by mapping for specified type. Documents  
> said "The parsing of dates uses Joda. The default date parsing used if no  
> format is specified is ISODateTimeFormat.dateOptionalTimeParser.".
> 
> ## How to change the default date format globally, not type specified?
> 
> View this message in context:  
> [http://n3.nabble.com/How-to-change-the-default-date-format-tp693607p693607.html](http://n3.nabble.com/How-to-change-the-default-date-format-tp693607p693607.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

### Author: ![HubertChang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hubertchang/32/3352_2.png) [@HubertChang](https://discuss.elastic.co/u/HubertChang)
#### Post date: [April 2, 2010, 10:06pm UTC](https://discuss.elastic.co/t/how-to-change-the-default-date-format/2886/3 "2010-04-02T22:06:42Z")

</div>

It's dynamic mapping.

Thanks.

---

<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 6, 2017, 4:24am UTC](https://discuss.elastic.co/t/how-to-change-the-default-date-format/2886/4 "2017-07-06T04:24:55Z")

</div>


