Support the ongoing development of Laravel.io →
Queues
Last updated 2 months ago.
0

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;
	}
Last updated 2 months ago.
0

Sign in to participate in this thread!

Cloudways

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.