Magento: How to get current date
How to Get Current Date:
Example:
Note: You will know more about Magento & Download latest version of Magento from http://www.magentocommerce.com/
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
Reviewed by Web Technology Funda
on
3:38:00 AM
Rating:
No comments