Answers for "how to current time in laravel"

PHP
0

indian time laravel

Go to your_project/config/app.php, there is a line:
	'timezone' => ''
set it to:
	'timezone' => 'Asia/Kolkata'

It will set the default timezone to Asia/Kolkata. After setting this you will 
get Indian time.

Here is the list of Supported Timezones
https://www.php.net/manual/en/timezones.php
Posted by: Guest on January-25-2021
0

how to get local current time in laravel

$dt = new DateTime($posts->updated_at);
$tz = new DateTimeZone('Asia/Kolkata'); // or whatever zone you're after

$dt->setTimezone($tz);
echo $dt->format('Y-m-d H:i:s');
Posted by: Guest on May-19-2021

Code answers related to "how to current time in laravel"

Browse Popular Code Answers by Language