title: how to convert mm/dd/yyyy format to dd/mm/yyyy in c#
body: <p>i want to show date time in dd/M/yyyy hh:mm:ss tt, but im getting error - </p>
  
  <blockquote>
    <p>System.FormatException: 'String was not recognized as a valid
    DateTime.'</p>
  </blockquote>
  
  <p>sample data 
  12/14/2018 8:11:30 PM</p>
  
  <p>Expected op
  14/12/2018 8:11:30 PM</p>
  
  <p>C# code</p>
  
  <pre><code>DateTime dt = DateTime.ParseExact(data.updatedDate.ToString(), "MM/dd/yyyy hh:mm:ss tt",CultureInfo.InvariantCulture);
                  string time = dt.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);
                  ViewBag.attendance_time = time;
  </code></pre>