Learn how to manage timezones in your Laravel Apps

In this video, Ben Holmen teaches us how to manage timezones in your Laravel apps. Some of the highlights include:

Here are the code samples used in the video:

In Application Timezone Macro

Carbon::macro('inApplicationTimezone', function() {
return $this->tz(config('app.timezone_display'));
});

In User Timezone Macro

Carbon::macro('inUserTimezone', function() {
return $this->tz(auth()->user()?->timezone ?? config('app.timezone_display'));
});

Give it a watch and learn all about Timezones and how to easily manage them!


The post Learn how to manage timezones in your Laravel Apps appeared first on Laravel News.

Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.