title: C# DateTime format with input from a string
body: <p>What I have:</p>
  
  <pre><code>string format = "yyyy.MM.dd HH:mm:ss:ffff";
  
  string eventdatetime = "2013.07.12 15:32:04:4687";
  </code></pre>
  
  <p>What I need to do is to take the eventdatetime string and put it into a DateTime variable, lets call it "x". And it needs to be in the format yyyy.MM.dd HH:mm:ss:ffff". Don't know if it is right but it should look like this: "2013.07.12 15:32:04:4687". It dosent work with:</p>
  
  <pre><code>DateTime x = DateTime.ParseExact(eventdatetime, format, System.Globalization.CultureInfo.InvariantCulture);
  </code></pre>
  
  <p>Anyone knows? I keep getting the AM/PM and wrong order. Wich tells me that the format didnt work.</p>