Hello friends, I want to know if a String is a valid date, and see the result in a MessageBox. The date is in the format “dd/mm/yyyy”.
For example, if the string is “01/01/2018”, it returns “It is valid”
If the string is “30/02/2018”, it returns “Not valid”, because February does not have 30 days.
If the string is “14/15/2018”, it returns “Not valid”, because there is no month 15.
Thanks friends!!
if (DateTime.TryParseExact(str, “dd/MM/yyyy”, null, DateTimeStyles.None, out dt) == true)
Try this and tell me if it works for you
1 Like
Hello Niket_Ghai, sorry, it doesn’t work .
This is my capture of screen.
1 Like
If you are using a flow decision you need not use ==True! Try removing ==True
I just remove it. I can see this:
The message is something like this:
A comma, or “)”, or the continuation of a valid expression was expected.
Yes! Gives the same error! I will look into this and get back to you soon
Thank you!! I appreciate it a lot!!
I have found a solution, which works for MM/dd/yyyy format! Will that work for you?
Juan_Perez
(Juan Perez)
10
Yes, no problem. I work with that format, and then I change it to the format I need. No problem
Juan_Perez
(Juan Perez)
12
Thank you so much Niket_Ghai
1 Like