I want to run my cron job in a specific time for example I want it to run it at
12:31:01
Is it possible?
Here is my code:
$schedule->command('UpdatePriceStatus:pricestatus')->weekdays()->dailyAt('12:31');
The documents in laravel doesn't include the seconds. But would it be possible if I do this:
$specificTime = '123101'
$currentTime = date('His');
$schedule->command('UpdatePriceStatus:pricestatus')->weekdays()->daily()->when(function () {
if ($specificTime == $currentTime) {
return true;
}
});
or this
$schedule->command('UpdatePriceStatus:pricestatus')->weekdays()->dailyAt('12:31:01');