Logo

Laravel Quick Tip No. 1: Changing Timezone for use with Carbon

Laravel allows you to change the timezone of your application. The only problem is, that you’ll need to manually add formatting to your carbon output.

Laravel Quick Tip No. 1: Changing Timezone for use with Carbon

Laravel allows you to change the timezone of your application. The only problem is, that you’ll need to manually add formatting to your carbon output.

But there’s a simple fix for that!

Add the following to your AppServiceProvider:

use Carbon\Carbon;
...
public function boot()(
{
    Carbon::setLocale('de');
}
...

That’s all to do the trick!

If you liked this tip, please like and share this tip ❤️

Let's stay in touch

Sign up for my newsletter and I will let you know about more content and new projects of mine once a month.