title: How to parse string to DateTime following PC regional setting
body: <p>The following code:</p>
  
  <pre><code>string s = DateTime.Now.ToString();
  DateTime dt;
  DateTime.TryParse(s, out dt);
  
  textBox1.AppendText(s + "\n");
  textBox1.AppendText(DateTime.Now + "\n");
  textBox1.AppendText(dt.ToString() + "\n");
  
  DateTime.TryParse(s,
                    CultureInfo.CurrentCulture.DateTimeFormat,
                    DateTimeStyles.None,
                    out dt);
  textBox1.AppendText(dt.ToString() + "\n");
  </code></pre>
  
  <p>produces the following output on the textbox:</p>
  
  <pre><code>13.09.2013 1602.38
  13.09.2013 1602.38
  01.01.0001 0000.00
  01.01.0001 0000.00
  </code></pre>
  
  <p>Why <code>TryParse</code> can't parse the string <code>s</code> to correct <code>DateTime</code> object? I want my program to be able to correctly parse the strings formatted like <code>s</code>. How can I do that?</p>
  
  <p>This is a C# WPF program running on .NET Framework 4.</p>