# Date time format new

**URL:** https://discuss.elastic.co/t/date-time-format-new/126867
**Category:** Elasticsearch
**Created:** [April 5, 2018, 7:47am UTC](https://discuss.elastic.co/t/date-time-format-new/126867 "2018-04-05T07:47:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Senthiles](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Senthiles](https://discuss.elastic.co/u/Senthiles)
#### Post date: [April 5, 2018, 7:47am UTC](https://discuss.elastic.co/t/date-time-format-new/126867/1 "2018-04-05T07:47:03Z")

</div>

Hi,  
Can any one suggest how to retrieve a date from index with formated. below is my mapping and value stored in index.

my mapping  
"createddate": {  
"type": "date"  
},

"createddate": "2018-03-30T08:30:46.865Z"

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [April 9, 2018, 8:28am UTC](https://discuss.elastic.co/t/date-time-format-new/126867/2 "2018-04-09T08:28:37Z")

</div>

Hey,

can you please describe your issue a bit more? What do you mean with `retrieve a date` - are you talking about writing a query that searches this field? If so, take a look at the [range query](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/query-dsl-range-query.html#ranges-on-dates).

If you meant something different, please elaborate.

Thank you!

--Alex

---

<div class="post-metadata">

### Author: ![Senthiles](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Senthiles](https://discuss.elastic.co/u/Senthiles)
#### Post date: [April 9, 2018, 10:20am UTC](https://discuss.elastic.co/t/date-time-format-new/126867/3 "2018-04-09T10:20:24Z")

</div>

"while getting the result from elastic search "  
for example the value stored in index is "2018-03-29T12:13:18.731Z"  
while getting the value i need to formated like "2018-03-29 12:13".

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [April 9, 2018, 11:41am UTC](https://discuss.elastic.co/t/date-time-format-new/126867/4 "2018-04-09T11:41:02Z")

</div>

hey,

the data elasticsearch returns here, is simply the data you stored. You could change this on index time (and also change the detection of the format when parsing this), you could use a script field (not recommended, as it's pretty slow) or you could just do an additional parsing step on the client side of things.

--Alex

---

<div class="post-metadata">

### Author: ![Senthiles](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Senthiles](https://discuss.elastic.co/u/Senthiles)
#### Post date: [April 9, 2018, 2:34pm UTC](https://discuss.elastic.co/t/date-time-format-new/126867/5 "2018-04-09T14:34:01Z")

</div>

thanks,

i am not displaying the value in client side. I need to export to csv using logstash. is there any way to parse the data in elastic search itself and also we need to search the date with timezone.

Senthil

---

<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: [May 7, 2018, 2:34pm UTC](https://discuss.elastic.co/t/date-time-format-new/126867/6 "2018-05-07T14:34:05Z")

</div>

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