title: PHP Format date yyyy-mm-ddThh:ii:ss to Y-m-d h:i:s
body: <p>i need to convert a date with this format (2017-06-14T08:22:29.296-03:00) to Y-m-d H:i:s. I take that date from an xml response from a soap service, And i need to check if the expiration date is less than the actual date.</p>
  
  <p>I have this and works OK on localhost, but when is uploaded to other server, i have validation problems:</p>
  
  <pre><code>if($wsaa-&gt;get_expiration() &lt; date("Y-m-d h:m:i")) {
      if ($wsaa-&gt;generar_TA()) {
          echo '&lt;br&gt;Nuevo Ticket de Acceso Generado'; 
      } else {
          echo '&lt;br&gt;No se pudo obtener ticket de acceso'; 
      }
  } else {
      echo '&lt;br&gt;TA expira:' . $wsaa-&gt;get_expiration(); 
  }
  </code></pre>
  
  <p>$wsaa->get_expiration() return 2017-06-14T08:22:29.296-03:00</p>
  
  <p>I tried to format the date but return with a few minutes of diff.</p>