# Get data between days

**URL:** <https://forum.inductiveautomation.com/t/get-data-between-days/61790>\
**Category:** Ignition\
**Created:** [July 12, 2022, 11:20am UTC](https://forum.inductiveautomation.com/t/get-data-between-days/61790 "2022-07-12T11:20:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [July 12, 2022, 11:20am UTC](https://forum.inductiveautomation.com/t/get-data-between-days/61790/1 "2022-07-12T11:20:05Z")

</div>

Hello, I need help please.

I have a **startDate like 2022, 7, 12** and I want get second date adding 31 days on startDate to get **2022,8, 12**

For exemple  
first = system.date.getDate(2022, 7, 12)

second = system.date.getDate(2022,8, 12) #I want get this date

print system.date.daysBetween(first,second) #print 31

---

<div class="post-metadata">

**Author:** ![louagejasper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/louagejasper/32/86311_2.png) [@louagejasper](https://forum.inductiveautomation.com/u/louagejasper)\
**Post date:** [July 12, 2022, 11:35am UTC](https://forum.inductiveautomation.com/t/get-data-between-days/61790/2 "2022-07-12T11:35:31Z")

</div>

```auto

first = system.date.getDate(2022, 7, 17)
print first
second = system.date.addDays(first, 31)
print second

print system.date.daysBetween(first,second)

```

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [July 12, 2022, 11:42am UTC](https://forum.inductiveautomation.com/t/get-data-between-days/61790/3 "2022-07-12T11:42:11Z")

</div>

Thank you Sr

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 12, 2022, 1:39pm UTC](https://forum.inductiveautomation.com/t/get-data-between-days/61790/4 "2022-07-12T13:39:16Z")

</div>

You may not be doing what I believe you are, but I thought it worth noting that there isn’t always ‘31’ days between the same day in different months.

If what you are really trying to do is move to the same day number in the next month, then you should use `system.date.addMonths(first,1)`

If that isn’t what you’re really looking for, then carry on.
