Check if date (with different format) is more than 6 months

Hi,

I have a business requirement where i need to check whether date is more than 3 months or not.

So, there is a webpage from where i will get the date details, i need to fetch every date one by one and check if its more than 3 months or not.

Issue is that date format different sometimes.
Sometimes it shows Unknown.

Please see the below screenshots for your reference.

How will I check these dates and verify if its more than 3 months or not.

Please suggest on this one.

Have you tried DateTime.Parse()

For more info, https://docs.microsoft.com/en-us/dotnet/api/system.datetime.parse?view=netcore-3.1

Can you please elaborate more on this and how will I use this ?

as you can see the date can appear as for exp, May 12, 2019 or yesterday or today something like that.

So need to know how will i use this here ?

@davemitra

Check below post

https://forum.uipath.com/t/tutorial-how-to-calculate-difference-between-two-time-values-using-uipath/247565/3

Hope this helps

Thanks

Say the date format is different when the date is:

  1. Unknown
  2. Yesterday
  3. ANy others?

If the exceptions are only the 2 above, then you can skip or set a date value for those to compare in your code. for example if contains yesterday, then Date= DateTime.Now.AddDays(-1).tostring(“format”).

1 Like

Tried with Regex and if Condition.

dates.xaml (7.0 KB)