title: Converting GMT time to local time using timezone offset in php
body: <p>I need to display user's activities date as per the current time zone.
  My approach -</p>
  
  <ol>
  <li>Getting a timezone offset from javascript and storing it to the user's profile table.</li>
  <li>When user logged in, getting time zone offset.</li>
  <li>current date is working fine with time zone offset-</li>
  </ol>
  
  <blockquote>
    <p>$offsetDiff = $_SESSION['TimeZone']*60;</p>
    
    <p>$UserDateTime = time() + $offsetDiff;</p>
    
    <p>$currentDate = date('Y-m-d',$UserDateTime);</p>
  </blockquote>
  
  <ol>
  <li>Dateo other then today is not working properly - </li>
  </ol>
  
  <blockquote>
    <p>$offsetDiff = $_SESSION['TimeZone']*60;</p>
    
    <p>$UserDateTime = '2014-02-10 08:58:00'; + $offsetDiff;</p>
    
    <p>$monthUser = date('Y-m-d',$UserDateTime);</p>
  </blockquote>
  
  <p>Can anybody please let me know how can i show correct date according to time zone offset?</p>