Skip to content

PHP code snippet – 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

echo $dt->format('Y-m-d H:i:s');
See also  How to check if a variable in Python is a specific data type?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.