I would like to print the time in local time in Laravel. If the user create a post it will display the created time on the server. How can I display it in local time ?
I found a solution to convert time to local time by using session. The current time zone offset will store on session to calculate users time. Create a jquery post function to post users timezone offset to session. This is my code,
default.blade.php
@if($current_time_zone=Session::get('current_time_zone'))@endif
// For assigning session value to hidden field.