Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Mithridates's avatar

Laravel Carbon date convertion

I have two attributes in my table created_at, updated_at.
Now in my view while getting created_at I wanna change:
1-The timezone for another country (for example UAE)
2-convert time to current time of that zone.
how do I do this?

0 likes
4 replies
Mithridates's avatar

@bobbybouwmann the times is saved in UTC, I imagine the app is used worldwide.
I wanna convert to suitable time zone in the ui.
Could I give the point?

bobbybouwmann's avatar

Just use the Carbon::setLocale('de'); function and set the local key in your ui.

Please or to participate in this conversation.