Scroll to top

How to use time and date function in php with indian timezone?

Use time and date function in php with indian timezone

<?php

if(function_exists(‘date_default_timezone_set’)) {
    date_default_timezone_set(“Asia/Kolkata”);
}

// then use the date functions, not the other way around
$date = date(“d/m/Y”);
$date1 =  date(“H:i a”);

echo $date . ‘<br/>’;
echo $date1;

?>

Leave a Reply

Your email address will not be published.