how to get local current time in laravel

Solutions on MaxInterview for how to get local current time in laravel by the best coders in the world

showing results for - "how to get local current time in laravel"
Emanuele
05 Aug 2020
1$dt = new DateTime($posts->updated_at);
2$tz = new DateTimeZone('Asia/Kolkata'); // or whatever zone you're after
3
4$dt->setTimezone($tz);
5echo $dt->format('Y-m-d H:i:s');
6