-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schedule command on last day of the month with a different timezone did not execute #49211
Comments
Hey there - are you able to send in a fix PR for this? |
Thank you for reporting this issue! As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub. If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team. Thank you! |
Created #49302 that implements the above, it requires a test though - I couldn't quite figure out how to mock the server timezone vs app config timezone bit in order to write it. |
@tntsoft I was struggling with the same issue. Maybe we can make it work with (found on SO):
I will try this tomorrow! |
Changing a server's timezone often requires restarting various services, |
Update: |
I will close the PR as the command has ran at the correct time and it was a configuration issue. My excuses for the trouble, but better safe than sorry. |
Laravel Version
10.30.1
PHP Version
8.2.6
Database Driver & Version
No response
Description
Situation:
We have a schedule:
We also have set the timezone to for the kernel to CET:
The server itself runs in UTC.
The
lastDayOfMonth
usesCarbon::now()
, but I believe it didn't take the timezone into account.Possible solution:
Add timezone when getting the last day of the month, like in the
inTimeInterval
method :Steps To Reproduce
$schedule->command(ExampleCommand::class)->lastDayOfMonth('23:30');
config/app.php
=>'schedule_timezone' => 'Europe/Amsterdam',
The text was updated successfully, but these errors were encountered: