new DateTime
  1. <?php
  2. $utc = "12:45:29 AM";
  3.  
  4. $dt = new DateTime($utc);
  5.  
  6. echo 'Original: ', $dt->format('r');
  7.  
  8. $tz = new DateTimeZone('Asia/Kolkata');
  9.  
  10. $dt->setTimezone($tz);
  11. echo 'After setting timezone: ', $dt->format('r');
  12. ?>
Parsed in 0.009 seconds