Skip to content

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