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:
$created = new DateTime("2012-11-20");
$expires = $created;
$expires->add(new DateInterval("P14D")); //adds a week
$timeLeft = $created->diff($expires);
echo $timeLeft->format('%a days');
The problem is this code returns 0 days always..