code: public static String format(ITemplate template, Object o, String pattern, Locale locale, String timezone) {
          if (null == o) return "";
          if (o instanceof Date) return format(template, (Date) o, pattern, locale, timezone);
          if (o instanceof Number) return format(template, (Number) o, pattern, locale);
          if (null == locale) {
              locale = I18N.locale(template);
          }
          RythmEngine engine = null == template ? RythmEngine.get() : template.__engine();
          if (null == engine) return o.toString();
          for(IFormatter fmt: engine.extensionManager().formatters()) {
              String s = fmt.format(o, pattern, locale, timezone);
              if (null != s) {
                  return s;
              }
          }
          return o.toString();
      }
docs: Generalize format parameter for the sake of dynamic evaluation
  @param o
  @param pattern
  @return a formatted string representation of the object