public static function formatFromConfig($type, $date) {
        $ini = Zend_Registry::get('config');
        $format = $ini->date->format->$type;

        if (strpos($format, '%') !== false) {
            return strftime($format, strtotime($date));
        } else {
            return date($format, strtotime($date));
        }
    }