# Elastic Date Math Rounding

**URL:** https://discuss.elastic.co/t/elastic-date-math-rounding/352027
**Category:** Elasticsearch
**Created:** [January 29, 2024, 6:04pm UTC](https://discuss.elastic.co/t/elastic-date-math-rounding/352027 "2024-01-29T18:04:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![AidenRourke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aidenrourke/32/122198_2.png) [@AidenRourke](https://discuss.elastic.co/u/AidenRourke)
#### Post date: [January 29, 2024, 6:04pm UTC](https://discuss.elastic.co/t/elastic-date-math-rounding/352027/1 "2024-01-29T18:04:10Z")

</div>

The date\_histogram aggregation has a parameter called offset. This property can be used to change a weekly bucket to be Monday to Sunday (the default) to Sunday to Saturday.

I'm wondering if there's a simliar solution for changing the start of week used in the date math operations.

For example, using "now/w" (with today being January 29th which is a monday) as the start in a range query will get me all documents since January 29th at 12:00am.

What if I want to update things so that "now/w" would give me all documents since January 28th at 12am?

---

<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: [February 26, 2024, 6:04pm UTC](https://discuss.elastic.co/t/elastic-date-math-rounding/352027/2 "2024-02-26T18:04:28Z")

</div>

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