# Rounding in date math

**URL:** <https://discuss.elastic.co/t/rounding-in-date-math/205008>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [October 24, 2019, 7:02am UTC](https://discuss.elastic.co/t/rounding-in-date-math/205008 "2019-10-24T07:02:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shan\_Chathusanda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shan_chathusanda/32/55382_2.png) [@Shan\_Chathusanda](https://discuss.elastic.co/u/Shan_Chathusanda)\
**Post date:** [October 24, 2019, 7:02am UTC](https://discuss.elastic.co/t/rounding-in-date-math/205008/1 "2019-10-24T07:02:16Z")

</div>

Hi,  
I am currently working on an alerting process of kibana watcher and I want to clarify the rounding of the date math in elasticsearch. As the [reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math) said `/d` of the date math will round the time to the nearest day. That means if the date string is `2019-10-24T11:00:00` and if we round it by using `/d` it will round to `2019-10-24T00:00:00`. Also if the date string is `2019-10-24-T13:00:00` rounded by `/d` will it rounded to `2019-10-24T00:00:00` or `2019-10-25T00:00:00`.  
Thanks,  
Shan Jayathilaka.

---

<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:** [October 24, 2019, 3:01pm UTC](https://discuss.elastic.co/t/rounding-in-date-math/205008/2 "2019-10-24T15:01:16Z")

</div>

this notation will always round to the current day and never round up.

---

<div class="post-metadata">

**Author:** ![Shan\_Chathusanda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shan_chathusanda/32/55382_2.png) [@Shan\_Chathusanda](https://discuss.elastic.co/u/Shan_Chathusanda)\
**Post date:** [October 25, 2019, 3:19am UTC](https://discuss.elastic.co/t/rounding-in-date-math/205008/3 "2019-10-25T03:19:50Z")

</div>

Hi @spinscale,  
Thank you for the reply. Could you please explain your answer a little bit?  
Thanks.

---

<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:** [October 25, 2019, 1:10pm UTC](https://discuss.elastic.co/t/rounding-in-date-math/205008/4 "2019-10-25T13:10:43Z")

</div>

You can read more about rounding here [https://www.elastic.co/guide/en/elasticsearch/reference/7.4/date-math-index-names.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/date-math-index-names.html)

Can you explain what is unclear so I can try and explain it better?

---

<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:** [November 22, 2019, 1:10pm UTC](https://discuss.elastic.co/t/rounding-in-date-math/205008/5 "2019-11-22T13:10:48Z")

</div>

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