1

In my order confirmation, I have this code

echo Mage::helper('core')->formatDate($_order->getData('created_at'),Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);

and the output is Order date: 16/03/2017 12.27.21

How do I remove the time from this output? So the correct output I want is Order date: 16/03/2017

1

Just pass last parameter as false

echo Mage::helper('core')->formatDate($_order->getData('created_at'),Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);

if you will see function definition then it will be more clear for you. Here it is

in file app/code/core/Mage/Core/Helper/Data.php line number approx 164

public function formatDate($date = null, $format = Mage_Core_Model_Locale::FORMAT_TYPE_SHORT, $showTime = false)
{
}

Hope it helps !! Thanks.

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.