Index: library/Zend/Date.php =================================================================== --- library/Zend/Date.php (Revision 9236) +++ library/Zend/Date.php (Arbeitskopie) @@ -282,7 +282,28 @@ } } + /** + * Returns a representation of a date or datepart + * This could be for example a localized monthname, the time without date, + * the era or only the fractional seconds. There are about 50 different supported date parts. + * For a complete list of supported datepart values look into the docu + * + * @param string|integer|Zend_Date|array $date OPTIONAL Date value or value of date part to set, + * depending on $part. If null the actual time is set + * @param string $part OPTIONAL Part of the date to return, if null the timestamp is returned + * @param string|Zend_Locale $locale OPTIONAL Locale for formating output + * @return integer|string date or datepart + */ + public static function format($date, $part = null, $locale = null) + { + if (!$date instanceof Zend_Date) { + $date = new Zend_Date($date); + } + return $date->get($part, $locale); + } + + /** * Returns this object's internal UNIX timestamp (equivalent to Zend_Date::TIMESTAMP). * If the timestamp is too large for integers, then the return value will be a string.