📜  如何在 laravel 中获取本地当前时间 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:36.200000             🧑  作者: Mango

代码示例1
$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');