I am using DateTime.TryParse() function to check if a particular string is a valid datetime not depending on any cultures. To my surprise , the function re
DateTime.TryParse()
Try using
DateTime.ParseExact( txtPaymentSummaryBeginDate.Text.Trim(), "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture );
It throws an exception if the input string is not in proper format, so in the catch section you can return false;
catch
return false;