Skip to content
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

[11.x] Apply default timezone when casting unix timestamps #50751

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

daniser
Copy link
Contributor

@daniser daniser commented Mar 25, 2024

Carbon 3 no longer apply default timezone while creating from unix timestamp

Laravel 11 supports both Carbon 2 and 3. I think it should behave the same regardless of installed Carbon version.
We may switch to the new behaviour in the next major version given that we'll drop support for Carbon 2.

@driesvints
Copy link
Member

@daniser can I confirm with you that you're using a different timezone in php.ini than UTC?

@driesvints driesvints self-assigned this Mar 25, 2024
@daniser
Copy link
Contributor Author

daniser commented Mar 25, 2024

@driesvints yes, both in php.ini and config/app.php.

@kylekatarnls
Copy link
Contributor

I confirm this change will make the method behave like in Carbon v2.

@driesvints driesvints marked this pull request as draft March 25, 2024 16:28
@taylorotwell taylorotwell marked this pull request as ready for review March 25, 2024 16:55
@taylorotwell taylorotwell merged commit 8c61f50 into laravel:11.x Mar 25, 2024
28 checks passed
@daniser daniser deleted the fix/timestamp-cast-tz branch March 25, 2024 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants