Date Conversions

Hi,
I have two date:-

  1. 11/08/17
    2)2019-03-05
    I want to take difference between these two date how to take.

HI @Rup_1

Check this post

Hi,
I tried but not getting result because format is different.
could you please provide sample xxml file for the same.

Please stop asking for xaml solutions. Here you can find information on how to parse the string to date

Hi @Rup_1,

You need to convert it to date format before you find difference.

DateDiff(DateInterval.day, Convert.toDatetime(β€œ11/08/17”),Convert.toDatetime(β€œ2019-03-05”))

or

DateDiff(DateInterval.day, DateTime.ParseExact(β€œ11/08/17”, β€œdd/MM/yy”,Globalization.CultureInfo.InvariantCulture),DateTime.ParseExact(β€œ2019-03-05”, β€œyyyy-MM-dd”,Globalization.CultureInfo.InvariantCulture))

@Vivek_Arunagiri teach the man to fish, don’t throw the fish to them…

3 Likes