title: String which is not in datetime format to DateTime
body: <p>I have a string which is not in a datetime format eg:<code>20160503</code>. How can i change it to Datetime. I tried using Substring. It is working.Is there any more efficient way? Below is what I have right now.</p>
  
  <pre><code>string a = "20160503";
  int b = Convert.ToInt32(a.Substring(0, 4));
  int c = Convert.ToInt32(a.Substring(4, 2));
  int d = Convert.ToInt32(a.Substring(6, 2));
  string date = b + "/" + c + "/" + d;
  DateTime result = new DateTime();
  DateTime.TryParse(date, out result);
  </code></pre>