# Dateformat usage in Elasticsearch index v1.7

**URL:** <https://discuss.elastic.co/t/dateformat-usage-in-elasticsearch-index-v1-7/35457>\
**Category:** Elasticsearch\
**Created:** [November 24, 2015, 1:52pm UTC](https://discuss.elastic.co/t/dateformat-usage-in-elasticsearch-index-v1-7/35457 "2015-11-24T13:52:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashit\_pupu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashit_pupu/32/101113_2.png) [@ashit\_pupu](https://discuss.elastic.co/u/ashit_pupu)\
**Post date:** [November 24, 2015, 1:52pm UTC](https://discuss.elastic.co/t/dateformat-usage-in-elasticsearch-index-v1-7/35457/1 "2015-11-24T13:52:35Z")

</div>

Hi

I am trying to store unixtimestamp as a value to a field in Elasticsearch Index. The version I am using is 1.7.3. While indexing the data mapping for the field is :-

```
         {"type":"date","format":"dateOptionalTime"}

```

the data is stored properly but when I try to query the particular field for date value I get parse exception. query used is :-

```
         {"query":{"term":{"contentPublishedTime":1447764265}}}

```

Error prompted :-

```
         IllegalArgumentException[Invalid format: "1447764265" is malformed at "5"]

```

I have tried using epoch\_millis and epoch\_second but it doesn't work.  
The same query and the same date format is working fine with v1.3 and lower version. I have read the documentation of v1.7 but there is no mention as such of dateformat. Am I missing something in this. Please help.

Thanks

---

<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 5, 2017, 11:36pm UTC](https://discuss.elastic.co/t/dateformat-usage-in-elasticsearch-index-v1-7/35457/2 "2017-07-05T23:36:15Z")

</div>


