title: PHP & MySQL: Converting Stored TIMESTAMP into User's Local Timezone
body: <p>So I have a site with a comments feature where the timestamp of the comment is stored in a MySQL database. From what I understand, the timestamp is converted to UTC when stored, then converted back to the default timezone when retrieved. In my case, my server is in the Central Daylight Time timezone (CDT).</p>
  
  <p>I have a plan to get the timezone from each user via entry form. I just wanted to know how to convert the TIMESTAMP value into the user's timezone.</p>
  
  <ul>
  <li>First, would I convert from UTC to local timezone? Or CDT to local timezone?</li>
  <li>Secondly, how would I go about doing that in PHP? Would I just do:</li>
  </ul>
  
  <pre>
  $userTimezone = new DateTimeZone($userSubmittedTimezoneString);
  $myDateTime = new DateTime($storedTimestamp, $userTimezone);
  </pre>
  
  <p>...or is that not correct?</p>