Dates between two dates

Hi,

How can we get the dates between two different dates?

For Eg: In this week, Monday is (26-03-2018) and Today date is (29-03-2018).
Now i want other dates (27-03-2018, 28-03-2018) between the above dates.

Thanks in advance!!!

1 Like

@Abishek

First take the datetime dt1=21/05/2018
Create a List of DateTime elements ListA

Now use while loop
Add condition
dt1.AddDays(inta)<dateTime.Now
Then use Add To collections
And Add dt1.AddDays(inta) into List A
now increment inta =inta+1

Regards,
Mahesh

3 Likes