3

I have tried the solution like Customer created_at Date off by months

when I use it it gives me error like

Call to undefined method Mage_Eav_Model_Entity_Attribute_Backend_Time_Created::_getFormat( )

even I have override by placing the created.php file in app/code/local/Mage/Eav/Model/Entity/Attribute/Backend/Time

divyang
  • 93
  • 1
  • 2
  • 6

1 Answers1

1

_getFormat() method is not available in Mage_Eav_Model_Entity_Attribute_Backend_Time_Created by default. I dont know, but I believe may be @Taylor is wrong in the usage of the function _getFormat().

The correct formatted code is now available from Magento version 1.8.1.0. This is not included in default Magento 1.8.0.0 or lower versions. So use that file instead of your default Created.php.


Note : When you override via local pool, make sure the file name is Created.php and not created.php. As Taylor pointed out in his answer, it is not a good practice to rewrite via local codepool. Instead use a module rewrite.

Rajeev K Tomy
  • 17,234
  • 6
  • 61
  • 103
  • My file name is allready Created.php. I got the same error when i have override it to my custom module. – divyang Jun 30 '15 at 07:37
  • replace file content with the content in the link that I have provided and then check again – Rajeev K Tomy Jun 30 '15 at 07:37
  • I found the solution , placed the function protected function _getFormat($date) { if (is_string($date) && preg_match('#^\d{4,4}-\d{2,2}-\d{2,2} \d{2,2}:\d{2,2}:\d{2,2}$#', $date)) { return 'yyyy-MM-dd HH:mm:ss'; } return null; } and works fine – divyang Jul 08 '15 at 13:44