Jump to content

convert system time to IST time


sandy1028

Recommended Posts

When the time in PST is:  Mon Jun 13 23:19:24 PDT 2011

IST time is  : Tue Jun 14 11:49:24 IST 2011

 

 

$date = new DateTime('2011-06-13 23:17:08', new DateTimeZone('Asia/Calcutta'));
echo $date->format('Y-m-d H:i:s') . "\n";

$date->setTimezone(new DateTimeZone('Pacific/Nauru'));
//$date->setTimezone(new DateTimeZone('Pacific/Nauru'));
echo $date->format('Y-m-d H:i:s') . "\n";

 

 

But this will not output the proper result

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.