Also the
$this->nextInterval()
method just returns an integer with the amount of time in seconds until the next quarter hour.
/**
* The amount of seconds until the next interval currently set to each 15 minutes
* This will round up so if it is is 12:05 it will round the next interval to 12:15
* if it is 12:32 it will be 12:45 and so on.
*
* @return int
*/
private function nextInterval()
{
$now = strtotime(date('h:i A'));
$next15 = ceil ($now / (15 * 60)) * (15 * 60);
return (int) $next15 - $now;
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community