Convert text with different formats to date.
Example:
Converted '01 02 2022 'to 2/1/2022.
Converted '11 / 2020 'to 11/1/2020.
Converted '01 / 05/2021 'to 5/1/2021.
Converted '2022/05/30' to 5/30/2022.
You have to pass 2 values to the function, date in text format that we want to convert and pattern.
Returns the transformed date if it is correct and if it fails it returns the null date of OutSystems: new DateTime (1900, 1, 1, 0, 0, 0)
Fixes in function