- Output for 5.5.24 - 5.5.31, 5.6.8 - 5.6.17, 7.0.0 - 7.0.2
- Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting ',' or ';' in /in/p6r8q on line 11
Process exited with code 255.
<?php
$lastDate = '1452504837';
$interval = 'P0Y0M1D';
$lastJob = new \Datetime();
$lastJob->setTimestamp($lastDate);
echo 'Last Sent: '.$lastJob->format('Y/m/d')." ";
$currentJob = new \Datetime();
echo 'Today: '.$currentJob->format('Y/m/d')."\n;
$interval = new DateInterval($interval);
echo 'Interval: '.$interval->format('%y years, %m months, %d days %H:%I:%S')."\n";
$sinceLastJob = $lastJob->diff($currentJob);
echo 'Since: '.$sinceLastJob->format('%y years, %m months, %d days %H:%I:%S')."\n";
if ($sinceLastJob > $interval) {
echo 'ready to send';
} else {
echo 'not ready to send.';
}