# How to map custom time format In Elasticsearch

**URL:** https://discuss.elastic.co/t/how-to-map-custom-time-format-in-elasticsearch/42877
**Category:** Elasticsearch
**Created:** [February 26, 2016, 5:07pm UTC](https://discuss.elastic.co/t/how-to-map-custom-time-format-in-elasticsearch/42877 "2016-02-26T17:07:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Vatsal\_Patel](https://avatars.discourse-cdn.com/v4/letter/v/ad7895/32.png) [@Vatsal\_Patel](https://discuss.elastic.co/u/Vatsal_Patel)
#### Post date: [February 26, 2016, 5:07pm UTC](https://discuss.elastic.co/t/how-to-map-custom-time-format-in-elasticsearch/42877/1 "2016-02-26T17:07:45Z")

</div>

I want to store time in below formate.

> PUT my\_index  
> {  
> "mappings": {  
> "my\_type": {  
> "properties": {  
> "date": {  
> "type": "date",  
> "format": "basic\_time\_no\_millis"  
> }  
> }  
> }  
> }  
> }

But it maps the document in

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

How can i change from` "dateOptionalTime"` to` "basic_time_no_millis"`.Thank you in advance

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 26, 2016, 10:38pm UTC](https://discuss.elastic.co/t/how-to-map-custom-time-format-in-elasticsearch/42877/2 "2016-02-26T22:38:46Z")

</div>

Are you sure the types are the same?

---

<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:13pm UTC](https://discuss.elastic.co/t/how-to-map-custom-time-format-in-elasticsearch/42877/3 "2017-07-05T23:13:11Z")

</div>


