2

I am Created one Custom Module called : Sigmasolve/Recipe. But Problem is that on Grid Page only Display Updated Time Column But not Display any Data in That Column. And also in Database only create column like updated_time but not store any "data" in that Field. I am Using Magento Version:1.9.2.3 . Any Kind of help will appreciated.

Vishwas Bhatnagar
4,7193 gold badges39 silver badges61 bronze badges
asked Dec 28, 2016 at 6:04
2
  • If only update_time column is empty than you may not have set the value for that while saving data from your controller Commented Dec 28, 2016 at 6:16
  • but what can I put in save action for updated_time Commented Dec 28, 2016 at 6:18

2 Answers 2

1

To save updated_time from your controller use this-

if you want to save current time

$yourModelCollection->setUpdatedTime(Varien_Date::now())->save();

Or if you want to save any particular date then

$yourModelCollection->setUpdatedTime('your_date')->save();
answered Dec 28, 2016 at 6:21
2

Add following function in your Sigmasolve/Recipe model file.

public function beforeSave()
{
 parent::beforeSave();
 $this->setUpdatedTime(Mage::getModel('core/date')->date('Y-m-d h:m:s'));
 return $this;
}
answered Dec 28, 2016 at 6:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.