# What is the better way of storing timestamp?

**URL:** <https://discuss.elastic.co/t/what-is-the-better-way-of-storing-timestamp/12483>\
**Category:** Elasticsearch\
**Created:** [June 19, 2013, 8:27pm UTC](https://discuss.elastic.co/t/what-is-the-better-way-of-storing-timestamp/12483 "2013-06-19T20:27:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinod\_eligeti](https://avatars.discourse-cdn.com/v4/letter/v/c4cdca/32.png) [@vinod\_eligeti](https://discuss.elastic.co/u/vinod_eligeti)\
**Post date:** [June 19, 2013, 8:27pm UTC](https://discuss.elastic.co/t/what-is-the-better-way-of-storing-timestamp/12483/1 "2013-06-19T20:27:02Z")

</div>

Hi,

I am wondering whether I should use Date object or long to store a  
timestamp? Can any of you provide pros and cons of both the approaches?

thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [June 19, 2013, 9:39pm UTC](https://discuss.elastic.co/t/what-is-the-better-way-of-storing-timestamp/12483/2 "2013-06-19T21:39:05Z")

</div>

In ES, it ends up to be a long (ms since epoch).  
I can't see any argument here in favor or not any approach.

My 2 cents

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 19 juin 2013 à 22:27, vinod eligeti [veligeti999@gmail.com](mailto:veligeti999@gmail.com) a écrit :

Hi,

I am wondering whether I should use Date object or long to store a timestamp? Can any of you provide pros and cons of both the approaches?

## thanks

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![vinod\_eligeti](https://avatars.discourse-cdn.com/v4/letter/v/c4cdca/32.png) [@vinod\_eligeti](https://discuss.elastic.co/u/vinod_eligeti)\
**Post date:** [June 19, 2013, 10:25pm UTC](https://discuss.elastic.co/t/what-is-the-better-way-of-storing-timestamp/12483/3 "2013-06-19T22:25:38Z")

</div>

Thanks David.

On Wed, Jun 19, 2013 at 2:39 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> In ES, it ends up to be a long (ms since epoch).  
> I can't see any argument here in favor or not any approach.
> 
> My 2 cents
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 19 juin 2013 à 22:27, vinod eligeti [veligeti999@gmail.com](mailto:veligeti999@gmail.com) a écrit :
> 
> Hi,
> 
> I am wondering whether I should use Date object or long to store a  
> timestamp? Can any of you provide pros and cons of both the approaches?
> 
> thanks
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/BEM-jVncnME/unsubscribe](https://groups.google.com/d/topic/elasticsearch/BEM-jVncnME/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:30am UTC](https://discuss.elastic.co/t/what-is-the-better-way-of-storing-timestamp/12483/4 "2017-07-06T02:30:19Z")

</div>


