title: Giving System.FormatException: String was not recognized as a valid DateTime. using datetime.ParseExact in C#
body: <p>I am below code in c#, where I am converting my string type format date to datetime, but giving the error.</p>
  
  <pre><code>if (!string.IsNullOrEmpty(SessionDictionary.GetValue("UserDetails", "ExpiryDate")))
  {
      DateTime ExpiryDate = DateTime.ParseExact(SessionDictionary.GetValue("UserDetails", "ExpiryDate"), "dd mmm yy", null);                      
      strDate = sitedata.FormatDate(ExpiryDate, TridionDateFormat.ShortDate);
  }
  else
  {
      strDate = "-";
  }
  </code></pre>
  
  <p>My <code>SessionDictionary.GetValue("UserDetails", "ExpiryDate")</code> is string type data which returns "31/01/2011 00:00:00" format date, in above code where I am using <code>DateTime.ParseExact</code> it is giving me <code>System.FormatException: String was not recognized as a valid DateTime.</code> error.</p>
  
  <p>Please suggest what is wrong.</p>
  
  <p>Thanks.</p>