# Date math explanation

**URL:** <https://discuss.elastic.co/t/date-math-explanation/178849>\
**Category:** Elasticsearch\
**Created:** [April 29, 2019, 7:12am UTC](https://discuss.elastic.co/t/date-math-explanation/178849 "2019-04-29T07:12:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ansamHox](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@ansamHox](https://discuss.elastic.co/u/ansamHox)\
**Post date:** [April 29, 2019, 7:12am UTC](https://discuss.elastic.co/t/date-math-explanation/178849/1 "2019-04-29T07:12:03Z")

</div>

I want to use visualization in dashboard to show number of logs for one day (from midnight to midnight). Used aggregation "Date Range" by field "log.timestamp", from now-1d/d to now/d, but I'm not sure it's showing correctly and the problem is that my timezone on kafka is somehow different.

When it is 0:00:01 (when new day starts), my logs have timestamp of day before at 22:00:01.

Basically, what is date range from-to I should set to to get count from only current day, on my index it is logs from eg 2019-01-01 22:00:00 to eg 2019-01-02 22:00:00

---

<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:** [April 30, 2019, 12:25pm UTC](https://discuss.elastic.co/t/date-math-explanation/178849/2 "2019-04-30T12:25:18Z")

</div>

Hey,

dates are stored as UTC, `now` is also using UTC date. Is it possible that the date you stored is not UTC but differs by two hours, and thus you are seeing that difference?

--Alex

---

<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:** [May 28, 2019, 12:25pm UTC](https://discuss.elastic.co/t/date-math-explanation/178849/3 "2019-05-28T12:25:41Z")

</div>

Closed on May 28, 2019, 12:25pm UTC

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