title: How to convert date time to unix command date
body: <p>How do I convert <strong>2014-10-10 04:13:24</strong> to <strong>2014-10-10T04:13:24+00:00</strong> in php or mysql</p>
  
  <p>The above mentioned date is for xml format in sitemaps</p>
  
  <p>For reference check <a href="http://www.sitemaps.org/faq.html#faq_computing_lastmod" rel="nofollow">Q: How do I compute lastmod date? (Sitemaps.org FAQ)</a></p>
  
  <p>code which i have tried: </p>
  
  <pre><code>    echo "GIVEN DATE ".$timestamp = "2014-10-10 04:13:24";
  echo "&lt;br&gt;";
  
  $year = date('Y',strtotime($timestamp)).";
  $month = date('m',strtotime($timestamp)).";
  $day = date('d',strtotime($timestamp))."";
  echo '&lt;br&gt;';
  $hour = date('H',strtotime($timestamp))."";
  $minutes = date('i',strtotime($timestamp))."";
  $seconds = date('s',strtotime($timestamp))."&lt;br&gt;";
  
  
  $gmktime= gmmktime($hour,$minutes,$seconds,$month,$day,$year)."&lt;br&gt;";
  
  echo "output date".$isodate = date('c', $gmktime);
  </code></pre>
  
  <p>is the above out put conversion correct?</p>
  
  <blockquote>
  <pre><code>**OUTPUT**
  
  GIVEN DATE : 2014-10-10 04:13:24
  
  output date : 2014-10-10T06:13:24+02:00
  </code></pre>
  </blockquote>