940 * Formats the given <code>Date</code> into a date/time string and appends |
940 * Formats the given <code>Date</code> into a date/time string and appends |
941 * the result to the given <code>StringBuffer</code>. |
941 * the result to the given <code>StringBuffer</code>. |
942 * |
942 * |
943 * @param date the date-time value to be formatted into a date-time string. |
943 * @param date the date-time value to be formatted into a date-time string. |
944 * @param toAppendTo where the new date-time text is to be appended. |
944 * @param toAppendTo where the new date-time text is to be appended. |
945 * @param pos the formatting position. On input: an alignment field, |
945 * @param pos keeps track on the position of the field within |
946 * if desired. On output: the offsets of the alignment field. |
946 * the returned string. For example, given a date-time text |
|
947 * {@code "1996.07.10 AD at 15:08:56 PDT"}, if the given {@code fieldPosition} |
|
948 * is {@link DateFormat#YEAR_FIELD}, the begin index and end index of |
|
949 * {@code fieldPosition} will be set to 0 and 4, respectively. |
|
950 * Notice that if the same date-time field appears more than once in a |
|
951 * pattern, the {@code fieldPosition} will be set for the first occurrence |
|
952 * of that date-time field. For instance, formatting a {@code Date} to the |
|
953 * date-time string {@code "1 PM PDT (Pacific Daylight Time)"} using the |
|
954 * pattern {@code "h a z (zzzz)"} and the alignment field |
|
955 * {@link DateFormat#TIMEZONE_FIELD}, the begin index and end index of |
|
956 * {@code fieldPosition} will be set to 5 and 8, respectively, for the |
|
957 * first occurrence of the timezone pattern character {@code 'z'}. |
947 * @return the formatted date-time string. |
958 * @return the formatted date-time string. |
948 * @exception NullPointerException if any of the parameters is {@code null}. |
959 * @exception NullPointerException if any of the parameters is {@code null}. |
949 */ |
960 */ |
950 @Override |
961 @Override |
951 public StringBuffer format(Date date, StringBuffer toAppendTo, |
962 public StringBuffer format(Date date, StringBuffer toAppendTo, |