- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$ts1 = strtotime(date('Y-m-d H:i:s'));
$ts2 = strtotime('2014-10-01 20:08:02');
$seconds_diff = $ts1 - $ts2;
$iNbDaysNotedAfterBuyingProject = ($seconds_diff/ 3600 / 24);
echo $iNbDaysNotedAfterBuyingProject;