How to check if the given string is in a valid customized format "yyyy-MM-dd h:mm:ss"?
For example:
2013-09-09 05:25:40
is in a valid format.
and
09-09-2013 05:25:40
is invalid format.
How to check if the given string is in a valid customized format "yyyy-MM-dd h:mm:ss"?
For example:
2013-09-09 05:25:40
is in a valid format.
and
09-09-2013 05:25:40
is invalid format.
You can use DateTime.TryParseExact() for this.