Can i convert GMT to IST in PHP without using PEAR.
Here is how i get GMT gmdate()
, now how do i convert it to IST.
Thanks
try
echo date('Y-m-d H:i:s',strtotime('+330 minutes', 0));
or
date_default_timezone_set('Asia/Kolkata');
echo date('Y-m-d H:i:s');
first get time by
$time = new DateTime('now', new DateTimeZone('UTC'));
// than convert it to IST by
$time->setTimezone(new DateTimeZone('IST'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With