fork(74) download
  1. <?php
  2. $utc = "2014-05-29T04:54:30.934Z";
  3.  
  4. $dt = new DateTime($utc);
  5.  
  6. echo 'Original: ', $dt->format('r'), PHP_EOL;
  7.  
  8. $tz = new DateTimeZone('Asia/Kolkata');
  9.  
  10. $dt->setTimezone($tz);
  11. echo 'After setting timezone: ', $dt->format('r'), PHP_EOL;
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Original: Thu, 29 May 2014 04:54:30 +0000
After setting timezone: Thu, 29 May 2014 10:24:30 +0530