# Date formatter does not detect milliseconds

**URL:** <https://discuss.elastic.co/t/date-formatter-does-not-detect-milliseconds/118071>\
**Category:** Elasticsearch\
**Created:** [February 1, 2018, 4:29pm UTC](https://discuss.elastic.co/t/date-formatter-does-not-detect-milliseconds/118071 "2018-02-01T16:29:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpadgett3339](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@rpadgett3339](https://discuss.elastic.co/u/rpadgett3339)\
**Post date:** [February 1, 2018, 4:29pm UTC](https://discuss.elastic.co/t/date-formatter-does-not-detect-milliseconds/118071/1 "2018-02-01T16:29:27Z")

</div>

I have been having issues with using a date formatter. I am running elasticsearch 6.1. I have ran multiple test scenarios and keep coming up with the same issue. If I include .SSS for milliseconds, the formatter does not recognize the input and my date becomes a string (ie: unsearchable error).

PUT /someindex  
{  
"mappings": {  
"sigui": {  
"properties": {  
"timestamp": {  
"type": "date",  
"format": "yyyy/MM/dd HH:mm:ss.SSS"  
}  
}  
}  
}  
}

POST /someindex/sometype/1001  
{  
"terminal":"025",  
"body":{  
"timestamp":"2018/01/26 12:23:45.123",  
"freeMemory":16024936,  
"data":{  
"properties":{  
"subState":"11038",  
"terminalNumber":"025",  
"dataCategory":"POS\_DEVICE",  
"element-name":"dataEvent"  
},  
"securePropertyMap":{

```
     },
     "nestLevel":0,
     "children":[

     ],
     "mUID":{
        "unique":-985307935,
        "time":1516994907293,
        "count":-31538
     }
  }

```

}  
}

* * *

If I drop the .SSS I my date is recognized and I am able to search my dates. What is causing the issue?  
Lastly, why can't I use a date in the format MM/dd/yyyy HH:mm:ss? Notice the order of the date.

PUT /someindex  
{  
"mappings": {  
"sigui": {  
"properties": {  
"timestamp": {  
"type": "date",  
"format": "yyyy/MM/dd HH:mm:ss"  
}  
}  
}  
}  
}

POST /someindex/sometype/1001  
{  
"terminal":"025",  
"body":{  
"timestamp":"2018/01/26 12:23:45",  
"freeMemory":16024936,  
"data":{  
"properties":{  
"subState":"11038",  
"terminalNumber":"025",  
"dataCategory":"POS\_DEVICE",  
"element-name":"dataEvent"  
},  
"securePropertyMap":{

```
     },
     "nestLevel":0,
     "children":[

     ],
     "mUID":{
        "unique":-985307935,
        "time":1516994907293,
        "count":-31538
     }
  }

```

}  
}

---

<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:** [March 1, 2018, 4:29pm UTC](https://discuss.elastic.co/t/date-formatter-does-not-detect-milliseconds/118071/2 "2018-03-01T16:29:59Z")

</div>

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