1

I am using Magento 1.9. In backend Manage Customer under Account Customer Account Creation on it shows wrong date.

I can't able to point out the problem can any one suggest this problem

enter image description here

in config.xml

<general>
            <locale>
                <code>en_US</code>
                <timezone>Asia/Calcutta</timezone>
            </locale>
        </general>

in mage.php

//date_default_timezone_set('UTC');
                date_default_timezone_set('Asia/Calcutta');
11
  • admin side check in configuration in locale Timezone Feb 12, 2016 at 10:56
  • That's fine because login time is working fine Account creation time only wrong
    – Magento 2
    Feb 12, 2016 at 11:15
  • can you paste screenshot of time zone? Feb 12, 2016 at 11:26
  • did you set it install time or later? Feb 12, 2016 at 11:31
  • Where? which means
    – Magento 2
    Feb 12, 2016 at 11:34

4 Answers 4

2
+50

you have to set your timezone manually

first go to

app/etc/config.xml add your time zone here

<general>
            <locale>
                <code>en_US</code>
                <timezone>Asia/Dubai</timezone>
            </locale>
        </general>

second go to app/Mage.php

on line 768

change this line too

date_default_timezone_set('UTC');

to your timezone

date_default_timezone_set('Asia/Dubai');

30
  • where i can add can you please give me the location
    – Magento 2
    Feb 12, 2016 at 11:53
  • both file location are there kindly change to your timezone. Feb 12, 2016 at 11:55
  • Ok i will check and give you feed back soon
    – Magento 2
    Feb 12, 2016 at 11:59
  • still now same problem also echo date('y/m/d h:i:s'); show wrong date only
    – Magento 2
    Feb 15, 2016 at 6:01
  • did you do the both work add your timzone in config.xml and Mage.php Feb 15, 2016 at 6:08
1

Check your server's date & time is correct.

Check that your Magento locale settings (esp. timezone) is set properly.

8
  • How to check server time
    – Magento 2
    Feb 9, 2016 at 14:40
  • If you have command line access, date would most likely the command to show current date and time (-zone). If you don't, connect via FTP, upload any file and see if the creation date and time is something near your current local time. (There might be some seconds difference due to delay caused by the actual file transfer and refreshing the directory view).
    – rob_st
    Feb 9, 2016 at 14:42
  • No i don't have that acess
    – Magento 2
    Feb 9, 2016 at 14:43
  • If you don't, connect via FTP, upload any file and see if the creation date and time is something near your current local time. (There might be some seconds difference due to delay caused by the actual file transfer and refreshing the directory view). Sorry, that part of the comment didn't go through the first time since i hit "RETURN" too fast :-)
    – rob_st
    Feb 9, 2016 at 16:44
  • I checked server time also not a problem on that it shows current time only
    – Magento 2
    Feb 11, 2016 at 19:47
0

This might be similar to Customer created_at Date off by months. I had same issue in one of my Magento.

0

I faced similar issue few days back all I did was creating my custom module Namespace > Modulename > Model > Entity Attribute > Backend > Time > Created.php

copy the Created.php file from app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time

after copying this file find and comment out the lines

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

In both beforeSave and afterSave function. The utcDate conversion is causing this weird issue. I did the above mentioned thing and this got resolved the very next moment.

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.