# Current time value in ES?

**URL:** <https://discuss.elastic.co/t/current-time-value-in-es/11636>\
**Category:** Elasticsearch\
**Created:** [April 18, 2013, 9:35pm UTC](https://discuss.elastic.co/t/current-time-value-in-es/11636 "2013-04-18T21:35:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OffensivelyBad\_2](https://avatars.discourse-cdn.com/v4/letter/o/51bf81/32.png) [@OffensivelyBad\_2](https://discuss.elastic.co/u/OffensivelyBad_2)\
**Post date:** [April 18, 2013, 9:35pm UTC](https://discuss.elastic.co/t/current-time-value-in-es/11636/1 "2013-04-18T21:35:30Z")

</div>

Is there a way to indicate the current timestamp or current date in an ES  
query? I would like to filter some visualizations I have running by a  
range of the previous 24 hours.

Is this possible?

--  
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:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 18, 2013, 11:10pm UTC](https://discuss.elastic.co/t/current-time-value-in-es/11636/2 "2013-04-18T23:10:49Z")

</div>

Yes, range queries and filters support "date math[https://github.com/elasticsearch/elasticsearch/issues/1708](https://github.com/elasticsearch/elasticsearch/issues/1708)  
".

On Thursday, April 18, 2013 5:35:30 PM UTC-4, OffensivelyBad wrote:

> Is there a way to indicate the current timestamp or current date in an ES  
> query? I would like to filter some visualizations I have running by a  
> range of the previous 24 hours.
> 
> Is this possible?

--  
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:** [April 19, 2013, 5:50am UTC](https://discuss.elastic.co/t/current-time-value-in-es/11636/3 "2013-04-19T05:50:23Z")

</div>

That said I would not use 'now' as a parameter but the end of the current day or tomorrow.  
You will have a better cache usage.

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

Le 19 avr. 2013 à 01:10, Igor Motov [imotov@gmail.com](mailto:imotov@gmail.com) a écrit :

Yes, range queries and filters support "date math".

On Thursday, April 18, 2013 5:35:30 PM UTC-4, OffensivelyBad wrote:

> Is there a way to indicate the current timestamp or current date in an ES query? I would like to filter some visualizations I have running by a range of the previous 24 hours.
> 
> Is this possible?  
> --  
> 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:** ![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:40am UTC](https://discuss.elastic.co/t/current-time-value-in-es/11636/4 "2017-07-06T02:40:30Z")

</div>


