# Mapping Time field without date

**URL:** https://discuss.elastic.co/t/mapping-time-field-without-date/43056
**Category:** Elasticsearch
**Created:** [February 29, 2016, 11:23pm UTC](https://discuss.elastic.co/t/mapping-time-field-without-date/43056 "2016-02-29T23:23:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![vgupta](https://avatars.discourse-cdn.com/v4/letter/v/67e7ee/32.png) [@vgupta](https://discuss.elastic.co/u/vgupta)
#### Post date: [February 29, 2016, 11:23pm UTC](https://discuss.elastic.co/t/mapping-time-field-without-date/43056/1 "2016-02-29T23:23:38Z")

</div>

Hi

In my logs, I have time field that only capture the time of the day. What should be mapping of this field should be in Elastic.

For e.g.

07:10:20 AM

08:20:50 PM

If I define the mapping as date with "format" : "hh:mm:ss a" then I get a timestamp from 1970 and if define the mapping as string then sorting and range queries become an issue.

Thanks  
Vinay

---

<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: [March 1, 2016, 5:52am UTC](https://discuss.elastic.co/t/mapping-time-field-without-date/43056/2 "2016-03-01T05:52:21Z")

</div>

You are better of fixing it before it goes into ES.

---

<div class="post-metadata">

### Author: ![vgupta](https://avatars.discourse-cdn.com/v4/letter/v/67e7ee/32.png) [@vgupta](https://discuss.elastic.co/u/vgupta)
#### Post date: [March 1, 2016, 6:23am UTC](https://discuss.elastic.co/t/mapping-time-field-without-date/43056/3 "2016-03-01T06:23:23Z")

</div>

Is there a way to just create a mapping for Time without the date?

Thanks

---

<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: [March 1, 2016, 6:29am UTC](https://discuss.elastic.co/t/mapping-time-field-without-date/43056/4 "2016-03-01T06:29:03Z")

</div>

If you really want to - [https://www.elastic.co/guide/en/elasticsearch/reference/2.2/mapping-date-format.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.2/mapping-date-format.html)

---

<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:12pm UTC](https://discuss.elastic.co/t/mapping-time-field-without-date/43056/5 "2017-07-05T23:12:40Z")

</div>


