Possible Timezone Bug In Cdateformatter?

I think I have come across a bug in the date formatting

We store all our date times in UTC in the database (without time zone)

Easiest to explain if I give an example

I’m trying to do something like this:

$dt = new DateTime($model->lastupdated, new DateTimeZone('UTC'));

echo Yii::app()->dateFormatter->formatDateTime($dt->getTimestamp(), 'short');

//outputs: "11/2/12 3:35:45 PM"

echo $dt->format('c'); 

//outputs: 2012-11-02T02:35:45+00:00

$model->lastupdated is a postgres date in the format "2012-11-02 02:35:45.446"

Problem is its not outputting the correct time

Its converting the time to the local time zone set in php.ini (date.timezone)

I think I have tracked it down to the call to CTimestamp::getDate()

Specifically the php function getdate() which seems to be converting the timestamp to local time

I think the getdate() function should be replace with a custom version that does no time zone conversions

Yii version: 1.1.11

PHP: 5.3.6

OS: Windows 7

Webserver: Apache 2.2.17

Browser: Chrome Version 22.0.1229.94 m