How do I convert a date stored in UTC to the user's current locale in PHP? I have a date stored in the database in UTC.

2016-01-13 09:01:16


I can query the database and output this date just fine. But it outputs in the date in the wrong timezone.

How do I adjust a date from the database into the current user's locale?

I believe this involves using craft()-&gt;timezone at some point, with some method, but I have not had any luck. I'm retrieving the date with the query builder:

$rows = craft()-&gt;db-&gt;createCommand()
         -&gt;select('dateCreated')
         -&gt;from('mytable')
         -&gt;queryAll();


Bonus points: sometimes I have multiple dates, so I need to modify all dates I get back into the right timezone.

More bonus points: at what point in the process is the best point to modify the date into the right timezone? In MySQL query? In PHP? In Twig?
Here is some code used in the past. 

$timezone = new \DateTimeZone(craft()-&gt;getTimeZone());
$newdate = \DateTime::createFromFormat(DateTime::MYSQL_DATETIME, $mysqlDate, $timezone);


I have typically done this before assigning to a model.