cancel
Showing results for 
Search instead for 
Did you mean: 

Determine remaining days in the month

LeeDuPlechian
Level 2
Hi, I'm trying to build a usage calculation where the usage is calculated based on the billing date, in this case the 13th of the month. I need to determine how many days left in the month depending on whether the month has 28, 29, 30 or 31 days. I tried converting the month to a number and then add variables to account for the months with 30 days etc but it seems a little convoluted. Any ideas?

------------------------------
Lee DuPlechian
------------------------------
2 REPLIES 2

Hi Lee,

Have you explored the Calendars VBO? The actions Get Working Days In Range and Count Working Days in Range may suit your purposes. 
Also check out this article on Calendar configuration: https://bpdocs.blueprism.com/bp-6-7/en-us/helpCalendar.htm

------------------------------
Patrick Aucoin
Senior Product Consultant
Blue Prism
------------------------------

NicholasZejdlik
Level 9
From a code stage you can use DateTime.DaysInMonth(), which will also cover you for leap days. I ran into some trickier situations with dates and found it easiest to create an object specifically for date handling functions.

------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------