PHP - Adding an interval to dates and getting the difference not working
<p>I want to have a countdown for how long until something expires, but it's not working. Specially, using the diff function of datetime returns essentially a dateinterval of nothing (all 0s). Here's the code:</p>

<pre><code>    $created = new DateTime("2012-11-20");
    $expires = $created;
    $expires-&gt;add(new DateInterval("P14D")); //adds a week
    $timeLeft = $created-&gt;diff($expires);
    echo $timeLeft-&gt;format('%a days');
</code></pre>

<p>The problem is this code returns 0 days always..</p>
