Created
July 10, 2012 12:44
-
-
Save abdev/3083037 to your computer and use it in GitHub Desktop.
Magento - format date from local format to magento internal format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$myDate = '07/10/12';//2012-07-10 | |
$format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); | |
$date = Mage::app()->getLocale()->date( | |
$myDate, | |
Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), | |
null, | |
false | |
); | |
$formatedDate = $date->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment