hmazter / laravel-schedule-list

Laravel package to add command to list all scheduled artisan commands
MIT License
94 stars 14 forks source link

Support timezones #42

Open joelmellon opened 4 years ago

joelmellon commented 4 years ago

When outputting next run time, scheduler timezones aren't recognized. There are two techniques for setting timezone listed in the docs: https://laravel.com/docs/7.x/scheduling#timezones

I don't have much time to work on something like this, but I thought it might be a useful feature request.

hmazter commented 4 years ago

Timezones should be handled when calculating next run, see: https://github.com/hmazter/laravel-schedule-list/blob/95776156968e18efe91bcb2e9828074fbbb0b72d/src/ScheduleEvent.php#L75-L77

I don't use timezones myself so I have not tested it in a real application. Could this be that it only handles one of the techniques for setting timezone?

joelmellon commented 4 years ago

@hmazter You're right. It does see the timezone, but it appears as if the timezone has been applied backward. 00:00 Los Angeles is 07:00 UTC, but this says 17:00 which is 10:00 Los Angeles. It looks like it's subtracting 7 instead of adding it. Am I losing my mind?

Screen Shot 2020-09-02 at 11 56 57 PM