Date in string bigger than a given date

Hello,

how can I compare the date contained in a string (string_date) with a given_date?

For example:
my_string = “The request has been closed on 31.12.2020” -->in this case string_date = 31.12.2020
given_date = 01.01.2021

The string_date is a variable.

The result would be for this example: given_date > string_date

Thank you

@monica.sl
Welcome to the forum

Assign Activity:
givenDate | DateTime =
DateTime.ParseExact(YourGivenDateString, “dd.MM.yyyy”, System.Globalization.CultureInfo.InvariantCulture).

Assign Activity:
stringDate | DateTime =
DateTime.ParseExact(YourStringDateString, “dd.MM.yyyy”, System.Globalization.CultureInfo.InvariantCulture).

check
givenDate.Date > stringDate.Date

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