How To Get The Day Count Of The Month In UiPath

In a few business processes that we automate, some times we have to count the number of days in a given month.

Let’s see how to do it in UiPath…

Int date_Variable = Datetime.DaysInMonth(_year,_month)

Note:
1.Replace the “_year” with your required “Year”
2.Replace the “_month” with your required “Month”


Example

Implementation using UiPath :

Let us implement a workflow which takes “Year” and “Month” as input and outputs the no.of days in that month i.e.

Step 1:
Drag “Input Dialogue” activity into the design panel and create a variable to save the “year” provided by the user.

UiPath Day Count Of The Month 1.PNG

Step 2:
Drag “Input Dialogue” activity into the design panel and create a variable to save the “month” provided by the user.

UiPath Day Count Of The Month 2.PNG

Step 3:
Drag “Message Box” activity into the design panel to display the days count.

UiPath Day Count Of The Month 3.PNG

Step 4:
Finally!!!

UiPath Day Count Of The Month 4.PNG

 

Click here to download the Source Code…

Hope it has helped you…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: