How to convert dd-mm-yyyy Format to MM/dd/yyyy in C#? : <p>I am trying to convert string <code>dd-mm-yyyy</code> to <code>MM/dd/yyyy</code>. I have tried different ways but nothing worked. My current logic is:</p>

<pre><code> string convertDate = DateTime.ParseExact(date, "dd-mm-yyyy", CultureInfo.InvariantCulture)
                      .ToString("MM/dd/yyyy",CultureInfo.InvariantCulture);
</code></pre>

<p>It is not converting the date as expected. It puts month on place of day and day on place of month and if day greater than 12 than it sets month to 01.</p>
