Hey,
I have three variable here. All three are in a DateTime formate, Lets say date1, date2, date3
I wanted to get the difference and compare it with date3. So, what I did I subtracted date1 - date2 which gave me a variable date4 which has a TimeSpan format. I wanted to compare this with date3.AddMonths(24)
so I wanted to check how can I compare a timeSpan value with a DateTime. I feel like i cannot compare but Is there any alternative way ?
@Rajat_16 Can you tell us what you are actually doing ? It would help us to understand the problem better , Also if you Consider Date2 as 08-05-2020 and Date1 as 07-05-2020, What output do you expect when Date2- Date1 is performed. Based on this answer we can provide you a Solution
So I have a list of dates and I am iterating in that list of dates and getting date1. I have a date2 already set to a date.
Now, all I am doing is calculating the difference between date1 - date2 or either way date2 - date1. now from this I have get a output which is in timespan. I wanted to compare if this timespan is < or > 24 months