I am using the following code for Short date validation.
DateTime dt = DateTime.Now;
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr-FR");
if (DateTime.TryParse(textBox1.Text, out dt))
{ textBox1.Text = dt.ToShortDateString(); }
But there is a small Problem, If user enters 1/1/1 the output looks like 01/01/2001.
if user enter 1-1-1 the output looks like 01/01/2001. Because of Format given by me.
now what i want if user enter like 1-1-1 the output should be 01-01-2001.