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

AtomCoder's avatar

Laravel Timezone Issues

I've built an API service/website where you can trigger various notifications to Slack, Twitter, Discord, Telegram etc.... via a HTTP request from your own website/application.

My problem is, the current timezone for my application is 'timezone' => 'Europe/Dublin', , which is fine to a certain extent. One feature of the API service is that I give users the ability to schedule notifications for a later date. This is an issue if someone using the application is outside this timezone.

How are Laravel users overcoming this issue? Are you guys setting the users timezone on the fly, auto detecting it or allowing a user to select their timezone during registration?

Be great to hear how you guys are dealing with timezone issues.

On a side note, anyone interested on playing about with my API application, you can see it here: JustPush API

Thanks in advance!

0 likes
1 reply
Swaz's avatar

I always leave the app timezone as UTC and convert on the fly. It makes things so much easier.

When a user registers, you can use javascript to detect their timezone behind the scenes, then submit that along with the other form data. I would still present an option for them to change it though.

You can get a list of timezones in php like this:

$timezones = DateTimeZone::listIdentifiers(DateTimeZone::EUROPE);
2 likes

Please or to participate in this conversation.