Magento: How to get current date

How to Get Current Date:
Example:

$currentTimestamp = Mage::getModel('core/date')->timestamp(time());
echo $currentDate = date('Y-m-d', $currentTimestamp);

How to format Dates:
Example:
$Date = '2013-05-15';
$dateTimestamp = Mage::getModel('core/date')->timestamp(strtotime($Date));
echo $currentDate = date('d.m.Y', $dateTimestamp);

Note: You will know more about Magento & Download latest version of Magento from http://www.magentocommerce.com/

Magento: How to get current date Magento: How to get current date Reviewed by Web Technology Funda on 3:38:00 AM Rating: 5

No comments

Free! Free!Free! Subscribe to Get Free PHP (Magento) tutorial Update in Your Inbox!!! Hurry Up!!!