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()->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()->db->createCommand()
->select('dateCreated')
->from('mytable')
->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?