Check format string that in format date "dd/mm/yyyy" or not?

my string = 01-02-21
I use this command in if condition ,
DateTime.TryParseExact(ExcelDT.Rows(0).Item(“GL_DATE”).ToString, “dd-MM’yyyy”, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None,Nothing)

it always return True.
I think it should return false

Please correct my logic.

1 Like

Hello @Supakinee_Navawong_na_ayu,

you can use IsMatches Activity to check,

use the below pattern to check,

\d{2}/\d{02}/\d{4}

Thank you .It’s work. :+1:

1 Like

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