title: Display the date in PHP from a datetime field in SQLExpress
body: <p>I have been crawling through the web and trying to find a solution so I am coming here.</p>
  
  <p>I have an MSSQL database and I am using PHP5.3 to connect and fetch data from one of the tables. The issue I am having has to do with dates.</p>
  
  <pre><code>$result = sqlsrv_query($conn, "SELECT TOP 10 * FROM TAData WHERE DateTime &gt;= '2013-11-11T07:45:00.000'");
  
  while($row = sqlsrv_fetch_array($result))
  {
  print_r ($row['DateTime']);
  echo "&lt;br /&gt;";
  echo date("Y-m-d H:i:s", strtotime($row['DateTime']));
  }
  </code></pre>
  
  <p>With the output looking like this:</p>
  
  <pre><code>DateTime Object ( [date] =&gt; 2013-11-11 07:46:08 [timezone_type] =&gt; 3 [timezone] =&gt; Africa/Johannesburg ) 
  
  January 1, 1970, 2:00 am
  </code></pre>
  
  <p>All I need is a simple date and time (YYYY-MM-DD HH:MM) that I can use. Once I have it in any sort of format (or understand how it works), I can manipulate it from there. But it is not displaying in any functional way.</p>