title: php convert timestamp to xml datetime
body: <p>In PHP, how do you convert a mysql timestamp like this "1125443836" 
  to an xml/date-time like this: </p>
  
  <pre><code>   &lt;wp:post_date&gt;2011-01-25 02:10:32&lt;/wp:post_date&gt; 
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  The columns in the mySQL are stored as int(10). </p>
  
  <p>Based on samples below, this is what I tried with two sample values in my database. 
  Something is wrong, maybe hash or Unix dates stored in mySQL table? </p>
  
  <pre><code>$testSqlDateStamp = "1125443836";
  echo "&lt;BR&gt;DateTest=".date('Y-m-d G:i:s',strtotime($testSqlDateStamp));
  
  $testSqlDateStamp = "1125444107";
  echo "&lt;BR&gt;DateTest=".date('Y-m-d G:i:s',strtotime($testSqlDateStamp));
  echo "&lt;BR&gt;";
  </code></pre>
  
  <p>Results:</p>
  
  <pre><code> DateTest=1969-12-31 18:00:00
   DateTest=1969-12-31 18:00:00
  </code></pre>
  
  <p><strong>Second Update: worked without calling strtotime</strong></p>
  
  <pre><code>$testSqlDateStamp = "1125444107";
  echo "&lt;BR&gt;DateTest=".date('Y-m-d G:i:s',$testSqlDateStamp);
  $testSqlDateStamp = "1125443836";
  echo "&lt;BR&gt;DateTest=".date('Y-m-d G:i:s',$testSqlDateStamp);
  </code></pre>
  
  <p>Results: </p>
  
  <pre><code>DateTest=2005-08-30 18:21:47
  DateTest=2005-08-30 18:17:16
  </code></pre>