- var_dump: documentation ( source)
<?php
$lastDate = '1452699936';
$interval = 'P0Y0M3D';
//create objects from strings
$interval = new \DateInterval($interval);
echo 'Interval: '.$interval->format('%y years, %m months, %d days')."\n";
//last sent
$lastJob = new \Datetime();
$lastJob->setTimestamp($lastDate);
//las sent + interval
$nextJob = new \Datetime();
$nextJob->setTimestamp($lastDate);
$nextJob->add($interval);
//now
$currentJob = new \Datetime();
echo 'Last Sent: '.$lastJob->format('Y/m/d').
' | Next Job: '.$nextJob->format('Y/m/d').
' | Today: '.$currentJob->format('Y/m/d')."\n";
var_dump($nextJob);
var_dump($currentJob);
if ($nextJob <= $currentJob) {
echo 'not ready to send.';
} else {
echo 'ready to send';
}