# How to handle "cannot parse empty date"?

**URL:** https://discuss.elastic.co/t/how-to-handle-cannot-parse-empty-date/245749
**Category:** Elasticsearch
**Created:** [August 20, 2020, 10:43am UTC](https://discuss.elastic.co/t/how-to-handle-cannot-parse-empty-date/245749 "2020-08-20T10:43:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Rachana\_Pole](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rachana_pole/32/49699_2.png) [@Rachana\_Pole](https://discuss.elastic.co/u/Rachana_Pole)
#### Post date: [August 20, 2020, 10:43am UTC](https://discuss.elastic.co/t/how-to-handle-cannot-parse-empty-date/245749/1 "2020-08-20T10:43:33Z")

</div>

Hi all,  
I had a field that provides date information in String format. I converted it to Date type format using mappings as shown in the below mapping sample.

```auto
Ex: 
"stats" : {
                  "properties" : {
                    "session_oldest_file_time" : {
                      "format" : "yyyy-MMM-dd HH:mm:ss",
                      "type" : "date"
                    }
           }
}

```

But after using the mappings, I am getting the below error in elasticsearch logs

```auto
 Preview of field's value: ''"}],"type":"mapper_parsing_exception","reason":"failed to parse field [stats.packet_oldest_file_time] of type [date] in document with id 'SBFzC3QBxBCv5W7hhl-gN6'. Preview of field's value: ''","caused_by":{"type":"illegal_argument_exception","reason":"cannot parse empty date"}},"status":400

```

Can anyone suggest how this can be handled?

---

<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 17, 2020, 10:43am UTC](https://discuss.elastic.co/t/how-to-handle-cannot-parse-empty-date/245749/2 "2020-09-17T10:43:43Z")

</div>

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