# Want to select date of last six month from the current date including current date

**URL:** <https://forum.getodk.org/t/want-to-select-date-of-last-six-month-from-the-current-date-including-current-date/31882>\
**Category:** Support\
**Tags:** odk-collect, odk-xlsform\
**Created:** [January 5, 2021, 9:44am UTC](https://forum.getodk.org/t/want-to-select-date-of-last-six-month-from-the-current-date-including-current-date/31882 "2021-01-05T09:44:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhupender\_Bhutani](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/bhupender_bhutani/32/14197_2.png) [@Bhupender\_Bhutani](https://forum.getodk.org/u/Bhupender_Bhutani)\
**Post date:** [January 5, 2021, 9:44am UTC](https://forum.getodk.org/t/want-to-select-date-of-last-six-month-from-the-current-date-including-current-date/31882/1 "2021-01-05T09:44:44Z")

</div>

How can i select date from last six months including current date.

I am using .\>=today()-180 in constraint but getting selected past date with future date

---

<div class="post-metadata">

**Author:** ![Grzesiek2010](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/grzesiek2010/32/2881_2.png) [@Grzesiek2010](https://forum.getodk.org/u/Grzesiek2010)\
**Post date:** [January 5, 2021, 11:30am UTC](https://forum.getodk.org/t/want-to-select-date-of-last-six-month-from-the-current-date-including-current-date/31882/2 "2021-01-05T11:30:48Z")

</div>

Hi @Bhupender_Bhutani  
You need to use [decimal-date-time()](https://docs.getodk.org/form-operators-functions/#converting-dates-and-time) function first to convert current date to number of days since January 1, 1970 then you can use something like:  
`. > decimal-date-time(today())-180 and . <= today()`
