I have this situation:
$date = new Zend_Date();
$date->toString(Zend_Date::DATE_MEDIUM);
- With 'it' locale this code outputs (e.g 04/mar/2013) instead of a dd/MM/yyyy format
- With 'en' locale it outputs (e.g. Mar 4, 2013) instead of a MM/dd/yyyy format
In the Zend Framework documentation I can read at Date and Time Formats (format varies by locale)
Updates:
/**
* Convert a date from yyyy/mm/dd formatted by the locale setting
*
* @param date $dbindata
* @param $format Zend_date format
* @return date formatted by the locale setting
*/
static public function formatDateOut($dbindata, $format=Zend_Date::DATE_MEDIUM) {
if (empty ( $dbindata ))
return false;
$locale = Zend_Registry::get('Zend_Locale');
$date = new Zend_Date($dbindata, "yyyy-MM-dd HH:mm:ss", $locale);
return $date->get($format);
}
Why?