# Retrieve string date and long date from query result

**URL:** <https://discuss.elastic.co/t/retrieve-string-date-and-long-date-from-query-result/104043>\
**Category:** Elasticsearch\
**Created:** [October 16, 2017, 3:53am UTC](https://discuss.elastic.co/t/retrieve-string-date-and-long-date-from-query-result/104043 "2017-10-16T03:53:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 16, 2017, 7:19am UTC](https://discuss.elastic.co/t/retrieve-string-date-and-long-date-from-query-result/104043/4 "2017-10-16T07:19:35Z")

</div>

> I guess I will format the date in front-end/server-end to resolve my problem

Probably easier indeed.

> it does not work when I search for the docs with the field specified.

If you want to go further, may be provide a full recreation script as described in

> [@About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21):
>
> The heart of the free and open Elastic Stack Elasticsearch is a distributed, RESTful search and analytics engine capable of addressing a growing number of use cases. As the heart of the Elastic Stack, it centrally stores your data for lightning fast search, fine‑tuned relevancy, and powerful analytics that scale with ease. warning PLEASE READ THIS SECTION IF IT'S YOUR FIRST POST Some useful links: [elasticsearch reference guide](http://www.elastic.co/guide/en/elasticsearch/reference/current/index.html)[elasticsearch user guide](http://www.elastic.co/guide/en/elasticsearch/guide/current/index.html)[elasticsearch plugins](https://www.elastic.co/guide/en/elasticsearch/plugins/current/index.html)[elasticsearch cl…](https://www.elastic.co/guide/en/elasticsearch/client/index.html)

It will help to better understand what you are doing.  
Please, try to keep the example as simple as possible.

---

_[View the full topic](https://discuss.elastic.co/t/retrieve-string-date-and-long-date-from-query-result/104043)._
