Define User timezone #927
Define User timezone #927
Conversation
this feature allow developers to define user timezone, when this is set, Carbon will apply given tz to the date before parsing into strings
This is really bad solution. You can see that in failing test. On other hand, people do not expect for |
Thanks, your code will be added as macro example: |
Thank you very much @thiagocordeiro for your approach. I've implemented the function name in my local project of this way: setDestinationTimezone(), because I needed both things, convert times from application to users and from users to application. IMO this way is better because of that. |
I cannot be sure as I don't see your code, but I don't think your approach is right. You should not convert from user timezone to application timezone. The browser can send UTC dates ( Here are some articles to explain deeply how to handle properly timezone front-side/back-side: |
this feature allow developers to define user timezone, when this is set, Carbon will apply given tz to the date before parsing into strings