Dear all,
I have to find the difference between the two date’s months and year.
Input String: “2021-09-02”, “2022-02-12”
Now I want the following list as the difference between two date
Sept-2021
Oct-2021
Nov-2021
Dec-2021
Jan-2022
Feb-2022
Kindly help to find the solution.
Best Regards,
Vrushali
Hi @Vrushali_Gave
can u try the sample syntax below
DateDifference = DateDiff(DateInterval.Day, Convert.todatetime(“04-25-2021”), Convert.todatetime(“01-27-2022”))
Also change DateDifference variable to Int
It will return the number of the days between the two dates as Integer
@nikhil.girish Thank you for the response
I want a month and year list from two date difference
TimK
(Tim Kok)
March 3, 2022, 10:30am
4
you could use a do while loop?
Start with your first date - then increment the month by 1 and add it to your list of strings.
I would convert the strings to date first as @nikhil.girish suggested.
Convert.todatetime(“04-25-2021”)
Your exit condition would be if your last date added matches your end date.
I would also check just months rather than dates.
Datetime.Month
Hi @Vrushali_Gave
DateDiff(DateInterval.Month, Convert.ToDateTime( “2016-01-30”),Convert.ToDateTime(“2016-05-30”)) — for month
hariapn
(Hari Kumar)
March 3, 2022, 10:43am
6
Hope below link helps to solve the issue..
Hi All,
My recent post on datatable [All About Datatable- UiPath] (https://forum.uipath.com/t/all-about-datatable-uipath/386445 ) was received well in forum with great feedbacks and many suggested to provide some tutorial on topics which are discussed often in our forum
In regards to that I would like to share the commonly used expression for DATETIME conversion
Let’s get started one by one
1. Get Current Date in string format
Datetime.Now.ToString()
(Output - string type - “dd/MM/yyyy hh:mm…
sarathi125
(Parthasarathi)
March 3, 2022, 1:37pm
7
@Vrushali_Gave ,
Check this xaml, it will give you the result you are looking for.
GetMonthsBetweenDates.xaml (6.4 KB)