Skip to content

Timezone for displayDate Helper defaults to config timezone #209

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neurotools
Copy link

If the user doesn't provide a timezone when calling displayDate Helper, the helper returns the name of the timezone and not the date (see Carbon::tz() usage).

imagen

With this PR, the timezone defaults to the one configured on app.timezone.

If the user doesn't provide a timezone when calling displayDate Helper, the helper returns the name of the timezone and not the date (see Carbon::tz() usage).
@JonoB
Copy link
Contributor

JonoB commented May 15, 2025

Something doesn't seem right here. If tz is null, then Carbon should use the server's timezone.

> \Carbon\Carbon::parse('2025-05-15')->copy()->tz(null);

= Carbon\Carbon @1747267200 {#5446
    date: 2025-05-15 00:00:00.0 UTC (+00:00),
  }

@neurotools
Copy link
Author

@JonoB What version of Carbon do you have? I just tried on my fresh installation:

\Carbon\Carbon::parse('2025-05-15')->copy()->tz(null);
= "America/Santiago"

I have Carbon 3.9.1

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.

2 participants