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

JuanDBB's avatar

Problem with dates

It seems that Spark ignores the locale set in the app configuration. Dates are utc and I cannot find how localize them into other languages (for example the trialEndsAt date generated via Vue).

Any recommendation?

Thank you in advance

0 likes
2 replies
Cronix's avatar
Cronix
Best Answer
Level 67

I store the user's timezone (created additional profile field) in the db, and then just convert to their tz when outputting dates.

echo $something->created_at->setTimezone($user->timezone)

For the locale issue, you can set Carbons locale in your AppServiceProvider, like: Carbon::setLocale('es');

1 like

Please or to participate in this conversation.