code: @Override
      public StringBuffer format(Calendar cal, StringBuffer toAppendTo,
                                 FieldPosition pos) {
          TimeZone backupTZ = null;
          if (cal != calendar && !cal.getType().equals(calendar.getType())) {
              // Different calendar type
              // We use the time and time zone from the input calendar, but
              // do not use the input calendar for field calculation.
              calendar.setTimeInMillis(cal.getTimeInMillis());
              backupTZ = calendar.getTimeZone();
              calendar.setTimeZone(cal.getTimeZone());
              cal = calendar;
          }
          StringBuffer result = format(cal, getContext(DisplayContext.Type.CAPITALIZATION), toAppendTo, pos, null);
          if (backupTZ != null) {
              // Restore the original time zone
              calendar.setTimeZone(backupTZ);
          }
          return result;
      }
docs: Formats a date or time, which is the standard millis
  since January 1, 1970, 00:00:00 GMT.
  <p>Example: using the US locale:
  "yyyy.MM.dd G 'at' HH:mm:ss zzz" -&gt;&gt; 1996.07.10 AD at 15:08:56 PDT
  @param cal the calendar whose date-time value is to be formatted into a date-time string
  @param toAppendTo where the new date-time text is to be appended
  @param pos the formatting position. On input: an alignment field,
  if desired. On output: the offsets of the alignment field.
  @return the formatted date-time string.
  @see DateFormat