title: convert string to datetime which handle all different formats in c# for excel and csv
body: <p>I am trying to read data from excel which has date in different formats .</p>
  <ul>
  <li><p>7/10/2019  3:03:01 PM</p>
  <pre><code>7/10/2019  13:03:12
  
  7/10/2019  3:07
  </code></pre>
  </li>
  </ul>
  <p>Also tried with below code
  if (DateTime.TryParseExact(sDate, &quot;dd/MM/yy HH:mm:ss&quot;, CultureInfo.InvariantCulture, DateTimeStyles.None, out dDate))</p>
  <p>it worked for few but not for all formats</p>
  <p>I'm Reading from excel file something like this:</p>
  <pre><code>foreach (DataRow dr in ds.Tables[0].Rows) 
  { 
      ob.id= dr[0].ToString();
  }
  </code></pre>