code: @Override
      public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {
          TimeZone tz = null;
          long date = System.currentTimeMillis();
  
          if (obj instanceof TimeZone) {
              tz = (TimeZone)obj;
          } else if (obj instanceof Calendar) {
              tz = ((Calendar)obj).getTimeZone();
              date = ((Calendar)obj).getTimeInMillis();
          } else {
              throw new IllegalArgumentException("Cannot format given Object (" +
                      obj.getClass().getName() + ") as a time zone");
          }
          assert(tz != null);
          String result = formatOffsetLocalizedGMT(tz.getOffset(date));
          toAppendTo.append(result);
  
          if (pos.getFieldAttribute() == DateFormat.Field.TIME_ZONE
                  || pos.getField() == DateFormat.TIMEZONE_FIELD) {
              pos.setBeginIndex(0);
              pos.setEndIndex(result.length());
          }
          return toAppendTo;
      }
docs: {@inheritDoc}