-
-
Save itmyprofession/5c7128bd5b40dee4d11651d54b2b80e0 to your computer and use it in GitHub Desktop.
Magento - format date from local format to magento internal format
This file contains hidden or 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