From c8712d4ccb6c5f3bd25c961f9844355c3c6bb3d2 Mon Sep 17 00:00:00 2001 From: Roy van Veldhuizen <18717340+royvanv@users.noreply.github.com> Date: Fri, 7 Jan 2022 17:38:28 +0100 Subject: [PATCH 1/2] Convert timezone from string to `DateTimeZone` object and set default. --- src/Illuminate/Console/Scheduling/ScheduleListCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php index 3b9780f13b6f..8434850f4adb 100644 --- a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php +++ b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php @@ -2,6 +2,7 @@ namespace Illuminate\Console\Scheduling; +use DateTimeZone; use Cron\CronExpression; use Illuminate\Console\Command; use Illuminate\Support\Carbon; @@ -39,7 +40,7 @@ public function handle(Schedule $schedule) $event->description, (new CronExpression($event->expression)) ->getNextRunDate(Carbon::now()->setTimezone($event->timezone)) - ->setTimezone($this->option('timezone', config('app.timezone'))) + ->setTimezone(new DateTimeZone($this->option('timezone') ?? config('app.timezone'))) ->format('Y-m-d H:i:s P'), ]; } From 17d3a1ab08d27f12dee67c138785df0c06438c72 Mon Sep 17 00:00:00 2001 From: Roy van Veldhuizen <18717340+royvanv@users.noreply.github.com> Date: Fri, 7 Jan 2022 17:45:34 +0100 Subject: [PATCH 2/2] Set order of `use` statements --- src/Illuminate/Console/Scheduling/ScheduleListCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php index 8434850f4adb..b1b0bdde59ff 100644 --- a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php +++ b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php @@ -2,8 +2,8 @@ namespace Illuminate\Console\Scheduling; -use DateTimeZone; use Cron\CronExpression; +use DateTimeZone; use Illuminate\Console\Command; use Illuminate\Support\Carbon;