# Storing Dates in Elastic Best Practices

**URL:** <https://discuss.elastic.co/t/storing-dates-in-elastic-best-practices/57496>\
**Category:** Elasticsearch\
**Created:** [August 8, 2016, 3:29pm UTC](https://discuss.elastic.co/t/storing-dates-in-elastic-best-practices/57496 "2016-08-08T15:29:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [August 8, 2016, 4:01pm UTC](https://discuss.elastic.co/t/storing-dates-in-elastic-best-practices/57496/2 "2016-08-08T16:01:07Z")

</div>

Internally, when you map any date as a date type, it will be converted to an epoch+milliseconds timestamp. _Internally._ This is how Elasticsearch is able to perform range queries against dates. But in the `_source`, your date will remain in the string representation you submitted.

See [https://www.elastic.co/guide/en/elasticsearch/reference/2.3/mapping-date-format.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/mapping-date-format.html)

Because it's stored in epoch, and epoch is presumed to be in UTC, then all dates should be submitted in UTC, or ISO8601 with a timezone offset.

---

_[View the full topic](https://discuss.elastic.co/t/storing-dates-in-elastic-best-practices/57496)._
