Date manipulation : Month Wanted

Hello everyone,

I have some challenge here and I’m wondering how to do it.

So, I have a working script that manipulates data and does its job fine. This script takes 2 dates as arguments, which delimitates a period upon which I extract data and transform it, so far so good.

The challenge now is that the action to perform on the data depends on the situation : the script can either be executed one a week interval, performing a light treatment; or on a month interval, performing a heavier treatment.

The question is, based on the 2 entry dates, how can I know if I am covering a month or not ?
Some hints :

  • I know I could calculate the number of days between the two dates, but for instance there is 30 days between the 15th of April and the 15th of Mai, yet it doesn’t cover a whole month, I need 1 - 30 april, 1-28 february, etc
  • the Now function is pointless, cause the treatment is asynchronous : There is always a varying delay between the moment when data is produced, and moment when it is treated.

I posted this in the How To section cause I am not yet fully aware of UiPath’s functionnalities, so I might be missing a key activity that would help me solve this problem…

Thanks for any advice / help / clue !

Have a nice day,

Heratom

Here you go … use the second answer.

https://forums.asp.net/t/1163565.aspx?calculate+number+of+months+between+two+dates+vb+net

1 Like

Thanks man, I didn’t think of using .net functionalities :blush: