[5.x] Allow different timezone from app timezone for displaying date+time in CP and Antlers #11388
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I already had a PR open for this (#10166) but accidentally deleted my fork 🫠 So here is a copy of the description:
Laravel encourages to not change the default UTC timezone in the config (https://laravel.com/docs/11.x/eloquent-mutators#date-casting-and-timezones), to prevent issues when comparing dates etc.
That said, I thought about how we could have both: the UTC timezone for all stored date/time values, but the values in the CP being displayed like in another timezone, for example Europe/Berlin, so if an editor in Germany tries to publish an entry immediately which has date+time enabled, it gets published right away and not when the UTC time is at the current point (so in one or two hours, depending on Daylight saving time)
I guess I did not find all places where that check and conversion should happen, so if you know of other places, please let me know :)
In general it should not change anything for existing and new installs, except the config value is set.