# ElasticSearch Date datatype

**URL:** <https://discuss.elastic.co/t/elasticsearch-date-datatype/8970>\
**Category:** Elasticsearch\
**Created:** [September 10, 2012, 6:00am UTC](https://discuss.elastic.co/t/elasticsearch-date-datatype/8970 "2012-09-10T06:00:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shanmuga](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@shanmuga](https://discuss.elastic.co/u/shanmuga)\
**Post date:** [September 10, 2012, 6:00am UTC](https://discuss.elastic.co/t/elasticsearch-date-datatype/8970/1 "2012-09-10T06:00:40Z")

</div>

Hi to all,

I am using Hibernate.4.0.1.Final. My Entity class have five fields,

```
         1. employeeId - Long
         2. empName - String
         3. empMobile - Long
         4. empAddress - String
         5. empDOB - <b>Date</b>

```

But my Elasticsearch field data types,

```
         1. employeeId - Long
         2. empName - String
         3. empMobile - Long
         4. empAddress - String
         5. empDOB -<b> Long</b>

```

Instead of empDOB datatype **Long to Date**.  
How Can I solve this One?

When am creating index using Java code... like

client.prepareIndex("indexName","type",id"+count).setSource(employee.getBytes()).execute().actionGet();

Here, how to mention datatype like entity class? Any one help me....

---

<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 6, 2017, 3:13am UTC](https://discuss.elastic.co/t/elasticsearch-date-datatype/8970/2 "2017-07-06T03:13:26Z")

</div>


