title: PHP - Convert date to YYYY-MM-DDTHH:MM:SS
body: <p>I was wondering if it was possible to format todays date to below format:</p>
  
  <pre><code>YYYY-MM-DDTHH:MM:SS
  </code></pre>
  
  <p>It's important that the "T" is preserved, like this:</p>
  
  <pre><code>2017-07-20T00:00:00
  </code></pre>
  
  <p>Below I have:</p>
  
  <pre><code>$invoice_date = date('Y-m-d H:i:s');
  </code></pre>
  
  <p>I can't figure out how to add the "T" in between.</p>