Magento 1.8 bug Invalid datetime in created_at in Magento 1.8 (or above)

While fetching customer info or product info or order info through Magento (1.8 and above) api, Value of “created_at” have values like “2011-12-19T11:04:39” Which is in wrong format and future in date.

To get correct timestamp and datetime value. Edit the following file in Magento folder


find following lines inside beforeSave() around line no. 67 and 68

$zendDate = Mage::app()->getLocale()->utcDate(null, $date, true, $this->_getFormat($date));
$object->setData($attributeCode, $zendDate->getIso());

comment out these lines

//$zendDate = Mage::app()->getLocale()->utcDate(null, $date, true, $this->_getFormat($date));
//$object->setData($attributeCode, $zendDate->getIso());

and inside afterLoad() method find follwing lines around line no. 85 and 86

$zendDate = Mage::app()->getLocale()->storeDate(null, $date, true, $this->_getFormat($date));
$object->setData($attributeCode, $zendDate->getIso());

comment out these lines

// $zendDate = Mage::app()->getLocale()->storeDate(null, $date, true, $this->_getFormat($date));
// $object->setData($attributeCode, $zendDate->getIso());

Now you will get correct timestamp and “created_at” value.