public function JobSchedulerCronTab::nextTime in Job Scheduler 7.2
Find the next occurrence within the next year as unix timestamp.
@codingStandardsIgnoreStart
Parameters
timestamp $start_time: Starting time.
int $limit: Default is 366.
File
- ./
JobSchedulerCronTab.inc, line 94 - JobSchedulerCronTab class.
Class
- JobSchedulerCronTab
- Jose's cron tab parser = Better try only simple crontab strings.
Code
public function nextTime($start_time = NULL, $limit = 366) {
// @codingStandardsIgnoreEnd
$start_time = isset($start_time) ? $start_time : time();
// Get minutes, hours, mday, wday, mon, year.
$start_date = getdate($start_time);
if ($date = $this
->nextDate($start_date, $limit)) {
return mktime($date['hours'], $date['minutes'], 0, $date['mon'], $date['mday'], $date['year']);
}
else {
return 0;
}
}