title: PHP convert UTC time to local time
body: <p>Am getting a UTC time from my server like the following format, my requirement is to convert the UTC time to local time. So users can see a user friendly time on their browser based on their timezone. Please help me to solve this issue. Thank you </p>
  
  <pre><code>$utc = "2014-05-29T04:54:30.934Z"
  </code></pre>
  
  <p>I have tried some methods but not working in my case </p>
  
  <p><strong>First</strong> </p>
  
  <pre><code>$time = strtotime($utc);
  $dateInLocal = date("Y-m-d H:i:s", $time);
  echo $dateInLocal;
  </code></pre>
  
  <p><strong>Second</strong> </p>
  
  <pre><code>$time = strtotime($utc .' UTC');
  $dateInLocal = date("Y-m-d H:i:s", $time);
  echo $dateInLocal;
  </code></pre>