# Date\_formats not working

**URL:** https://discuss.elastic.co/t/date-formats-not-working/6668
**Category:** Elasticsearch
**Created:** [February 10, 2012, 10:16am UTC](https://discuss.elastic.co/t/date-formats-not-working/6668 "2012-02-10T10:16:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Wojciech\_Durczynski](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@Wojciech\_Durczynski](https://discuss.elastic.co/u/Wojciech_Durczynski)
#### Post date: [February 10, 2012, 10:16am UTC](https://discuss.elastic.co/t/date-formats-not-working/6668/1 "2012-02-10T10:16:10Z")

</div>

Hello.

It seems that date\_formats doesn't work as expected.  
Everything is described in following gist:

> <https://gist.github.com/Avatah/1788431>

  
Am I doing something wrong?

Regards  
Wojciech Durczyński

---

<div class="post-metadata">

### Author: ![Shairon\_Toledo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shairon_toledo/32/2490_2.png) [@Shairon\_Toledo](https://discuss.elastic.co/u/Shairon_Toledo)
#### Post date: [February 10, 2012, 11:09am UTC](https://discuss.elastic.co/t/date-formats-not-working/6668/2 "2012-02-10T11:09:34Z")

</div>

Hello

Have you ever checked the right formats expect by Joda date parser?

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

[http://joda-time.sourceforge.net/api-release/org/joda/time/format/DateTimeFormat.html](http://joda-time.sourceforge.net/api-release/org/joda/time/format/DateTimeFormat.html)

2012/2/10 Wojciech Durczyński [wojciech.durczynski@comarch.com](mailto:wojciech.durczynski@comarch.com)

> Hello.
> 
> It seems that date\_formats doesn't work as expected.  
> Everything is described in following gist:  
> [Elastic Search date\_format problem · GitHub](https://gist.github.com/1788431)  
> Am I doing something wrong?
> 
> Regards  
> Wojciech Durczyński

--  
's  
Shairon Toledo  
[http://www.google.com/profiles/shairon.toledo](http://www.google.com/profiles/shairon.toledo)

---

<div class="post-metadata">

### Author: ![Wojciech\_Durczynski](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@Wojciech\_Durczynski](https://discuss.elastic.co/u/Wojciech_Durczynski)
#### Post date: [February 10, 2012, 11:12am UTC](https://discuss.elastic.co/t/date-formats-not-working/6668/3 "2012-02-10T11:12:36Z")

</div>

Of course.  
And I'd like to use "basic\_date\_time" format. It looks like  
this: yyyyMMdd’T’HHmmss.SSSZ  
And I configured "basic\_date\_time" as a default format, what doesn't work.

---

<div class="post-metadata">

### Author: ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)
#### Post date: [February 10, 2012, 11:51am UTC](https://discuss.elastic.co/t/date-formats-not-working/6668/4 "2012-02-10T11:51:31Z")

</div>

On Fri, 2012-02-10 at 02:16 -0800, Wojciech DurczyÅski wrote:

> Hello.
> 
> It seems that date\_formats doesn't work as expected.  
> Everything is described in following gist:  
> [Elastic Search date\_format problem · GitHub](https://gist.github.com/1788431)

I can confirm that this looks broken. Please open an issue  
demonstrating the problem (and remove the dynamic mapping, it is still  
broken without that)

ta

clint

---

<div class="post-metadata">

### Author: ![Wojciech\_Durczynski](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@Wojciech\_Durczynski](https://discuss.elastic.co/u/Wojciech_Durczynski)
#### Post date: [February 10, 2012, 1:13pm UTC](https://discuss.elastic.co/t/date-formats-not-working/6668/5 "2012-02-10T13:13:45Z")

</div>

Issue created:

> <https://github.com/elastic/elasticsearch/issues/1690>

---

<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: [February 12, 2012, 1:40pm UTC](https://discuss.elastic.co/t/date-formats-not-working/6668/6 "2012-02-12T13:40:27Z")

</div>

This happens because there is a basic check to see if something is a date by looking for :, -, and / in the string before trying to parse it. Otherwise, is 20120101 a numeric number or a date? I guess we can improve that to also look for T, and if its there, try and parse.

On Friday, February 10, 2012 at 3:13 PM, Wojciech Durczyński wrote:

> Issue created:  
> [date\_formats doesn't work · Issue #1690 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1690)

---

<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, 3:39am UTC](https://discuss.elastic.co/t/date-formats-not-working/6668/7 "2017-07-06T03:39:46Z")

</div>


