1

I'm trying to figure out how can I change the created_at date of a product.

can somebody point me in the right direction on how to do it?

I can't even find where it's stored in the database.

1 Answer 1

3

Usually this would be handled automatically by Magento it self.

The structure of the data is a MySQL DateTime format YYYY-MM-DD HH:MM:SS and is stored within the catalog_product_entity (although other tables will store this information for individual elements of data as well)

You should be able to update it by using the Magento model.

$model = Mage::getModel('catalog/product')->load(1); 
$model->setCreatedAt('2015-01-01 09:00:00'); 
$model->save(); 

Note however that you may require to be within the admin context as front end product model may not allow saving of the product for security reasons.

1
  • Thank you John Cuthbert. That actually helped me a lot!! I wrote a similar script but it wasn't working... that's because I didn't call Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); thank you for pointing that out!!! and thank you for the help p.s. I can't comment nor accept your answer, I don't know why
    – user129887
    Commented Jul 16, 2015 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.