0
Magento 1.9.1
Porto theme

We haven't changed any settings but strange things are starting to happen such as when the customer registers on the website - it is assigning the incorrect date value. Also we are having problems with cookies (getting the "Shopping Cart is Empty" Error which usually happens for us when the date/time is out of sync somehow).

One customer registered today and it says:

Account Created on: Jun 5, 2018 9:16:27 AM which is obviously not possible.

Is there a setting on the server that needs to be changed so that it is reporting the correct date/time? Or what other setting within Magento needs to be checked?

I just did a sort by the date and it appears that we have 8 customers in total with future registration dates all the way up to December 2nd, 2018.

I contacted the hosting company and this is what they replied:

"Thank you for your reply! Sun May 6 16:39:06 -06 2018 - the server date and time are correct. Where's the registration form taking it's date/time feed from? Perhaps you need to look this up on your Magento installation. If it's set to lookup the server time upon registration, it will be the correct one."

| improve this question | | | | |
  • Did you find the solution? – Vivek Kumar May 14 '18 at 6:02
0

I had the same problem , I resolved it by overriding save action , as mentioned here -how to override the product controller in admin panel

and setting created at attribute manually to store's time and date as follows;

$product->setData('created_at',Mage::getModel('core/date')->date('Y-m-d H:i:s'));
| improve this answer | | | | |
0

i had same issue with product created_at column you have to use

Mage::getModel('core/date')->gmtDate() 

instead of

$zendDate->getIso()

Override model as mention here

below is the solution.

open following file : app\code\core\Mage\Eav\Model\Entity\Attribute\Backend\Time\Created.php

and comment out beforeSave() function and replace with following function code.

public function beforeSave($object)
{
    $attributeCode = $this->getAttribute()->getAttributeCode();

    $date = $object->getData($attributeCode);

    if (is_null($date)) {
        if ($object->isObjectNew()) {

            $object->setData($attributeCode, Varien_Date::now());
        }
    } else {
        // convert to UTC
        $zendDate = Mage::app()->getLocale()->utcDate(null, $date, true, $this->_getFormat($date));

        // Replace -> $zendDate->getIso() with Mage::getModel('core/date')->gmtDate()
        $object->setData($attributeCode, Mage::getModel('core/date')->gmtDate());
    }

        return $this;
    }

Detail reference link

i am sure it will help to you.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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