How to Get Current Date Time in Magento?

If you are looking to get the current date and time with specific format being used currently from the database then use the following code with specific syntax to get the information right away.


Mage::getModel('core/date')->date('Y-m-d H:i:s');

OR


date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time()));

You may also like...

Leave a Reply

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