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

[Proposal] createFromTimestampCurrentTZ #18

Open
arokettu opened this issue Jan 23, 2025 · 2 comments
Open

[Proposal] createFromTimestampCurrentTZ #18

arokettu opened this issue Jan 23, 2025 · 2 comments

Comments

@arokettu
Copy link

A follow up for briannesbitt/Carbon#2966 and briannesbitt/Carbon#3017

Proposal: bring back old behavior as new methods createFromTimestampCurrentTZ() and createFromTimestampMsCurrentTZ()

This behavior was too useful to ignore and having a more explicit name for it would make it more semantic

@kylekatarnls
Copy link
Contributor

Hello, what's the benefit over passing date_default_timezone_get() as a second parameter?

@arokettu
Copy link
Author

  1. With date_default_timezone_get() it looks long and clumsy
  2. A very common use case
  3. Carbon seems to be a set of useful helpers for DateTime and in my opinion this one qualifies
  4. Yes it depends on the external state but with a new name it's explicit about it

Your call of course, I'm just suggesting

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

No branches or pull requests

2 participants