Conversation between two time zone

Conversation between two time zone :
A simple method for Conversation between two timezone is as below :

Conversation between two time zone

<?php
   /*Time zone 1*/
   date_default_timezone_set('America/New_York'); 
   $date = new DateTime(date("Y-m-d H:i:s"), new DateTimeZone('America/New_York'));
   /*Time zone 2*/
   date_default_timezone_set("Asia/Kolkata"); 
   echo date("Y-m-d h:iA", $date->format('U'));
?>

You can change the timezone as per your country.


Advertisements

Add Comment

📖 Read More