How to get total number of days in Last two years

How to get total number of days in Last two years?

I just need all days (including working & non working days). Sometimes day count will be changed due to leap years

HI @palwis

Welcome to UiPath community

Use Assign activity

 (DateTime.Now - DateTime.Now.AddYears(-2)).Days

image

Regards
Gokul

1 Like

@palwis

totalDays = DateTime.Now.Subtract(DateTime.Now.AddYears(-2)).TotalDays + 1

1 Like

Hi @palwis

Here is the xaml with your expected output
BlankProcess3.zip (378.3 KB)

Hope it helps!!

1 Like

@Gokul001 Thank You for your answer. I used this as “Total_Dates=(DateTime.Now - DateTime.Now.AddYears(-2)).Days+1” and now it’s working properly.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.