Hey guys, ich have two dates as String (DD.MM.YYYY), i want to get all Dates between them.
Do you have an smart idea or is there an activity or something?
My first idea was to split the strings at the points, convert the numbers to int32, and compare the numbers and every time they don’t match to count one up and save the result as new Date and loop that all until the Dates match.
But is this the only way or ist there an easier way?
Fine
lets take input like
in_date = “28.11.2019”
and
out_date = “03.01.2020”
where in_date and out_date is a string variable
there are totally four steps
–assign activity
–while loop
–assign activity
–writeline activity
the steps involved are
–in a assign activity like this final_date = Datetime.ParseExact(in_date,“dd.MM.yyyy”,system.globalization.cultureinfo.invariantculture)
where final_date is a datetime variable
–now use a while loop and mention condition like this final_date > Datetime.ParseExact(out_date,“dd.MM.yyyy”,system.globalization.cultureinfo.invariantculture)
–inside the loop use a assign activity like this Final_date = Datetime.ParseExact(Final_date,“dd.MM.yyyy”,system.globalization.cultureinfo.invariantculture).AddDays(1)
–now use a write line activity and mention like this Final_date.ToString(“dd.MM.yyyy”)