Change returning datetime Time zone to recalculate with user Time zone – Laravel

Use the code below to set time zone in Laravel.

<!-- wp:loos-hcb/code-block -->
<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code></code></pre></div>
<!-- /wp:loos-hcb/code-block -->

Then change the returning time zone to recalculate with a user’s time zone in Laravel.

// on a date column

// Directly on a Carbon instance 
Carbon\Carbon::parse('2018-01-22 04:09:31')->timezone('Asia/Kolkata')->toDateTimeString()

Check out these Links
Actual Article:

Laravel allows you to dynamically set timezone using the package given below.

Look up this package below, you can Automatically Set a Local Timezone for Users:

Leave a Comment