datetime parse issue c#
<p>datetime parse work exactly when date format is like mm/dd/yyyy but when dateformat is like dd/mm/yyyy then problem occur. i want to write code to parse date whatever format is used.</p>

<p>suppose if my date is like "15/01/2012" or 05/12/2012 then my code can parse it as valid datetime. so what should i do... i use code like </p>

<pre><code>IFormatProvider culture = new System.Globalization.CultureInfo("en-US", true);
string xxx = DateTime.ParseExact("15/12/2012", "yyyyMMdd", culture).ToString();
</code></pre>

<p>it does not work because dateformat is dd/mm/yyyy. so tell me the best solution that when date format would be dd/mm/yyyy or mm/dd/yyyy etc but code can parse it properly. so guide me what code i should use. thanks</p>
