1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +00:00
laravel-tips/content/tips/use-carbons-settimezone-and-shifttimezone-methods.md
2022-03-06 19:20:10 +01:00

610 B

title tweet_id thread_slug author_username images created_at slug
Use Carbon's setTimezone() and shiftTimezone() methods 1499806904515584001 weekly-thread-2022-09 danjharrin
https://pbs.twimg.com/media/FMw6UNgXMAYuWrS.jpg
2022-03-04T18:00:05+00:00 use-carbons-settimezone-and-shifttimezone-methods

Over the past few years, I've worked on some large apps that deal with events in different timezones. This can end up being quite confusing, as best practice is always to store dates in UTC.

That's where Carbon's shiftTimezone() and setTimezone() methods can help you out! ⬇️