Difference between dates which is in 20200717 format

Hello. Please help me with getting date differences. Date is in this format “20200717” that is “yyyymmdd”. I need to get the difference of “20200717” - Today’s date. Output must be in days. Please help.

Thank you

@Pavan_Patke
have a look here:

(DateTime.ParseExact("20200717","yyyyMMdd", CultureInfo.InvariantCulture) - Now).Days

with following:
Math.Abs((DateTime.ParseExact("20200717","yyyyMMdd", CultureInfo.InvariantCulture) - Now).Days)


the day difference in Absolut (no negative value for a minus difference) is retrieved

Hi @Pavan_Patke

(DateTime.ParseExact(DateTime.Now.ToString(“yyyyMMdd”), “yyyyMMdd”, System.Globalization.CultureInfo.InvariantCulture)-DateTime.ParseExact(“20200717”, “yyyyMMdd”, System.Globalization.CultureInfo.InvariantCulture)).TotalDays

Output :-
image

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Thank you guys. I’ll give a try and I’ll get back to you. :blush:

Hello Pratik. May I request you to share the .xaml file for this?

Hi @Pavan_Patke

Sure. Below is the Workflow for the same.

MainPratik.xaml (7.2 KB)

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

HI @Pavan_Patke

Delete the post in which you have put your personal details. As it is not allowed to post personal details anywhere.

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Sure. Thank you. I’ll do it right away.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.