# Date format parse error

**URL:** https://discuss.elastic.co/t/date-format-parse-error/217234
**Category:** Elasticsearch
**Created:** [January 30, 2020, 3:41pm UTC](https://discuss.elastic.co/t/date-format-parse-error/217234 "2020-01-30T15:41:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![F\_eq\_kx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/f_eq_kx/32/62217_2.png) [@F\_eq\_kx](https://discuss.elastic.co/u/F_eq_kx)
#### Post date: [January 30, 2020, 3:41pm UTC](https://discuss.elastic.co/t/date-format-parse-error/217234/1 "2020-01-30T15:41:30Z")

</div>

I'm getting `Caused by: java.lang.IllegalArgumentException: failed to parse date field [Thu Jan 30 15:31:42 +00:00 2020] with format [strict_date_optional_time||epoch_millis||E M dd HH:mm:ss Z yyyy]` when ingesting some data into Elasticsearch, but I can't figure out why.

I see the problematic date is `Thu Jan 30 15:31:42 +00:00 2020` so I added `E M dd HH:mm:ss Z yyyy` as a custom date pattern. Shouldn't this pattern match the date? I haven't been able to find any good ways to test ES date pattern matching.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [January 31, 2020, 9:29am UTC](https://discuss.elastic.co/t/date-format-parse-error/217234/2 "2020-01-31T09:29:37Z")

</div>

Hey,

try

```auto
EEE MMM dd HH:mm:ss XXX yyyy

```

I recently wrote a small tool to easier play with parsing date formats. It's available at [https://esddd.herokuapp.com/](https://esddd.herokuapp.com/)

I tried the above datepattern in combination with `Thu Jan 30 15:31:42 +00:00 2020` as the data to check, and the parsing worked.

As you can see java dates are a bit tricky with regards to the length of those letters (`E` vs. `EEE`) as those have different meanings how to interpret the input.

hope this helps!

---

<div class="post-metadata">

### Author: ![F\_eq\_kx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/f_eq_kx/32/62217_2.png) [@F\_eq\_kx](https://discuss.elastic.co/u/F_eq_kx)
#### Post date: [January 31, 2020, 1:36pm UTC](https://discuss.elastic.co/t/date-format-parse-error/217234/3 "2020-01-31T13:36:32Z")

</div>

Awesome, thanks! You guys should add your link to the date formatting docs! Very useful.

---

<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: [February 28, 2020, 1:44pm UTC](https://discuss.elastic.co/t/date-format-parse-error/217234/4 "2020-02-28T13:44:04Z")

</div>

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