# Date field format issue

**URL:** https://discuss.elastic.co/t/date-field-format-issue/245988
**Category:** Elasticsearch
**Created:** [August 22, 2020, 1:14pm UTC](https://discuss.elastic.co/t/date-field-format-issue/245988 "2020-08-22T13:14:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![razor-tazor](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@razor-tazor](https://discuss.elastic.co/u/razor-tazor)
#### Post date: [August 22, 2020, 1:14pm UTC](https://discuss.elastic.co/t/date-field-format-issue/245988/1 "2020-08-22T13:14:54Z")

</div>

I have the following query that I'm trying to run on Elasticsearch 5.6 in Kibana Dev Tools:

```
    {
  "query": {
    "bool": {
      "filter": {
        "bool": {
          "must": [
            {
              "range": {
                "inserted": {
                  "gt": "Thu Aug 20 09:01:31 +0100 2020"
                }
              }
            }
          ]
        }
      }
    }
  }
}

```

the response I'm getting is:

```
{
  "error": {
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "failed to parse date field [Thu Aug 20 09:01:31 +0100 2020] with format [EEE MMM dd HH:mm:ss ZZZ yyyy]"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "can_match",
    "grouped": true,

```

The datetime format looks correct to me, what am I doing wrong?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [August 22, 2020, 1:19pm UTC](https://discuss.elastic.co/t/date-field-format-issue/245988/2 "2020-08-22T13:19:30Z")

</div>

If you look at [the docs for the date type](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/date.html) the default format, if you have not specified something else in your mappings, is `strict_date_optional_time`, e.g. `2015-01-01T12:10:30Z`. The format you used is not standard.

---

<div class="post-metadata">

### Author: ![razor-tazor](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@razor-tazor](https://discuss.elastic.co/u/razor-tazor)
#### Post date: [August 22, 2020, 1:42pm UTC](https://discuss.elastic.co/t/date-field-format-issue/245988/3 "2020-08-22T13:42:37Z")

</div>

Yes I know the field is not on the default format, but I do need to query for that format.  
The format I'm using seems to be the one it wants, why can it not parse?

thanks

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [August 22, 2020, 1:45pm UTC](https://discuss.elastic.co/t/date-field-format-issue/245988/4 "2020-08-22T13:45:12Z")

</div>

Have you specified that format in your mappings for that field? If not I believe you need to do so.

---

<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: [September 19, 2020, 1:45pm UTC](https://discuss.elastic.co/t/date-field-format-issue/245988/5 "2020-09-19T13:45:17Z")

</div>

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