Receives a wrong output when saving the date of birth as 01.01.1970 during the customer registration.

Receives a wrong output n magento when saving the date of birth as 01.01.1970 during the customer registration OR updating the customer information.

Solutions:

  • Copy the Dob.php file in app\code\core\Mage\Customer\Block\Widget to corresponding local path.
  • Edit the function setDate($date)
    And add the below code:


if(strtotime($date) == "0"){
$this->setTime($date);
}
Then the function will be:
public function setDate($date)
{
//01.01.1970 – DOB issue -start
if(strtotime($date) == "0"){
$this->setTime($date);
}
//01.01.1970 – DOB issue -end
else{
$this->setTime($date ? strtotime($date) : false);
}
$this->setData('date', $date);
return $this;
}

This entry was posted in Magento Developer Notes. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *