Hello Everybody.
Simple question i think for you but i dont’ find any strong solution until now.
I have two variables already in datetime format.
Like
date_1 = 01.01.2022
date_2 = 14.10.2022
My goal is to find if date 1 is previous month compared to date2
How can i achieve this goal?
Ex: date1 = 01.01.2022 is previous month compared to date2
date2 = 01.12.2021 is previous month compared to date2
date3 = 01.10.2021 is previous month compared to date2
date4 = 01.10.2022 is current month compared to date2
we can parse the date string into a date by following (kindly note some variations on the smaples)
and can use the dateDiff method for the checks (position of the parameters counts)
Kindly note: DateDiff will not return fractions of a unit and can have side effects e.g. we want to retrieve the information of “Complete of X” X - year, month…