# Wrong date math expression calculation with week value

**URL:** <https://discuss.elastic.co/t/wrong-date-math-expression-calculation-with-week-value/162521>\
**Category:** Elasticsearch\
**Created:** [December 31, 2018, 1:38pm UTC](https://discuss.elastic.co/t/wrong-date-math-expression-calculation-with-week-value/162521 "2018-12-31T13:38:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![singrahu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/singrahu/32/12985_2.png) [@singrahu](https://discuss.elastic.co/u/singrahu)\
**Post date:** [December 31, 2018, 1:38pm UTC](https://discuss.elastic.co/t/wrong-date-math-expression-calculation-with-week-value/162521/1 "2018-12-31T13:38:25Z")

</div>

While trying to create an index in Elasticsearch with date math exprssion in it, wrong index is being created.  
Today is `31st Dec 2018`, and running following command creates an index named `tests-2018.01`

```auto
#PUT /<tests-{now/w{YYYY.ww}}> 
PUT /%3Ctests-%7Bnow%2Fw%7BYYYY.ww%7D%7D%3E

```

According to [ISO-8601](https://www.epochconverter.com/weeknumbers), it should have been `tests-2019.01`.

---

<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:** [January 28, 2019, 1:38pm UTC](https://discuss.elastic.co/t/wrong-date-math-expression-calculation-with-week-value/162521/2 "2019-01-28T13:38:27Z")

</div>

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