title: DateTime timestamp has period instead of colon
body: <p>I have a Datatable with two DateTime columns: date_from and date_to.</p>
  
  <pre><code>string dateFrom = row["date_from"].ToString();
  string dateTo = row["date_to"].ToString();
  </code></pre>
  
  <p>When this code is run in a customer environment, it returns dates in the following format:</p>
  
  <pre><code>"2016-01-01 00.00.00"
  "2016-02-01 00.00.00"
  </code></pre>
  
  <p>This string is then inserted into SQL:</p>
  
  <pre><code>SELECT * FROM my_table
  WHERE UPPER(status) = 'N'
  AND trans_date &gt;= {ts '1900-01-01 00.00.00' }
  AND trans_date &lt;= {ts '1900-01-01 00.00.00' }
  </code></pre>
  
  <p>When this SQL is executed it returns the error "Conversion failed when converting date and/or time from character string."</p>
  
  <p>So a quick fix for this is to run a string.Replace() where I replace period with colon:</p>
  
  <pre><code>dateFrom = dateFrom.Replace(".", ":");
  </code></pre>
  
  <p>However, my question is rather why the date is returned with periods as the timestamp separator and not colons?</p>
  
  <p>I have created this test on my local machine, but unfortunately for this scenario it returns a correct representation of the DateTime string:</p>
  
  <pre><code>DataTable table = new DataTable();
  table.Columns.Add("date", typeof(DateTime));
  
  DataRow row = table.NewRow();
  row["date"] = DateTime.Now;
  table.Rows.Add(row);
  
  DateTime date = DateTime.Parse(table.Rows[0]["date"].ToString());
  </code></pre>
  
  <p>My guess so far would be that it has something to do with the customers culture, but I would really appreciate input from someone who has experience with this so I can give feedback to the customer about why this happened in the first place.</p>
  
  <p>It might just be a coincidence, but it is worth mentioning that this only happens for users with Windows 10. Everyone using Windows 7 does not get this error.</p>