< prev index next >

src/java.base/share/classes/java/time/format/DateTimeFormatter.java

Print this page
rev 55400 : [mq]: 8220229


 379  * If the count of letters is four, then the full name is output.
 380  * Five or more letters throws {@code IllegalArgumentException}.
 381  * <p>
 382  * If the pattern letter is 'v' the output provides the zone name ignoring
 383  * daylight savings time. If the count of letters is one, then the short name is output.
 384  * If the count of letters is four, then the full name is output.
 385  * Two, three and five or more letters throw {@code IllegalArgumentException}.
 386  * <p>
 387  * <b>Offset X and x</b>: This formats the offset based on the number of pattern
 388  * letters. One letter outputs just the hour, such as '+01', unless the minute
 389  * is non-zero in which case the minute is also output, such as '+0130'. Two
 390  * letters outputs the hour and minute, without a colon, such as '+0130'. Three
 391  * letters outputs the hour and minute, with a colon, such as '+01:30'. Four
 392  * letters outputs the hour and minute and optional second, without a colon,
 393  * such as '+013015'. Five letters outputs the hour and minute and optional
 394  * second, with a colon, such as '+01:30:15'. Six or more letters throws
 395  * {@code IllegalArgumentException}. Pattern letter 'X' (upper case) will output
 396  * 'Z' when the offset to be output would be zero, whereas pattern letter 'x'
 397  * (lower case) will output '+00', '+0000', or '+00:00'.
 398  * <p>
 399  * <b>Offset O</b>: This formats the localized offset based on the number of
 400  * pattern letters. One letter outputs the {@linkplain TextStyle#SHORT short}
 401  * form of the localized offset, which is localized offset text, such as 'GMT',
 402  * with hour without leading zero, optional 2-digit minute and second if
 403  * non-zero, and colon, for example 'GMT+8'. Four letters outputs the
 404  * {@linkplain TextStyle#FULL full} form, which is localized offset text,
 405  * such as 'GMT, with 2-digit hour and minute field, optional second field
 406  * if non-zero, and colon, for example 'GMT+08:00'. Any other count of letters
 407  * throws {@code IllegalArgumentException}.

 408  * <p>
 409  * <b>Offset Z</b>: This formats the offset based on the number of pattern
 410  * letters. One, two or three letters outputs the hour and minute, without a
 411  * colon, such as '+0130'. The output will be '+0000' when the offset is zero.
 412  * Four letters outputs the {@linkplain TextStyle#FULL full} form of localized
 413  * offset, equivalent to four letters of Offset-O. The output will be the
 414  * corresponding localized offset text if the offset is zero. Five
 415  * letters outputs the hour, minute, with optional second if non-zero, with
 416  * colon. It outputs 'Z' if the offset is zero.
 417  * Six or more letters throws {@code IllegalArgumentException}.
 418  * <p>
 419  * <b>Optional section</b>: The optional section markers work exactly like
 420  * calling {@link DateTimeFormatterBuilder#optionalStart()} and
 421  * {@link DateTimeFormatterBuilder#optionalEnd()}.
 422  * <p>
 423  * <b>Pad modifier</b>: Modifies the pattern that immediately follows to be
 424  * padded with spaces. The pad width is determined by the number of pattern
 425  * letters. This is the same as calling
 426  * {@link DateTimeFormatterBuilder#padNext(int)}.
 427  * <p>




 379  * If the count of letters is four, then the full name is output.
 380  * Five or more letters throws {@code IllegalArgumentException}.
 381  * <p>
 382  * If the pattern letter is 'v' the output provides the zone name ignoring
 383  * daylight savings time. If the count of letters is one, then the short name is output.
 384  * If the count of letters is four, then the full name is output.
 385  * Two, three and five or more letters throw {@code IllegalArgumentException}.
 386  * <p>
 387  * <b>Offset X and x</b>: This formats the offset based on the number of pattern
 388  * letters. One letter outputs just the hour, such as '+01', unless the minute
 389  * is non-zero in which case the minute is also output, such as '+0130'. Two
 390  * letters outputs the hour and minute, without a colon, such as '+0130'. Three
 391  * letters outputs the hour and minute, with a colon, such as '+01:30'. Four
 392  * letters outputs the hour and minute and optional second, without a colon,
 393  * such as '+013015'. Five letters outputs the hour and minute and optional
 394  * second, with a colon, such as '+01:30:15'. Six or more letters throws
 395  * {@code IllegalArgumentException}. Pattern letter 'X' (upper case) will output
 396  * 'Z' when the offset to be output would be zero, whereas pattern letter 'x'
 397  * (lower case) will output '+00', '+0000', or '+00:00'.
 398  * <p>
 399  * <b>Offset O</b>: With a non-zero offset, this formats the localized offset
 400  * based on the number of pattern letters. One letter outputs the
 401  * {@linkplain TextStyle#SHORT short} form of the localized offset, which is
 402  * localized offset text, such as 'GMT', with hour without leading zero, optional
 403  * 2-digit minute and second if non-zero, and colon, for example 'GMT+8'. Four
 404  * letters outputs the {@linkplain TextStyle#FULL full} form, which is localized
 405  * offset text, such as 'GMT, with 2-digit hour and minute field, optional second
 406  * field if non-zero, and colon, for example 'GMT+08:00'. If the offset is zero,
 407  * only localized text is output. Any other count of letters throws
 408  * {@code IllegalArgumentException}.
 409  * <p>
 410  * <b>Offset Z</b>: This formats the offset based on the number of pattern
 411  * letters. One, two or three letters outputs the hour and minute, without a
 412  * colon, such as '+0130'. The output will be '+0000' when the offset is zero.
 413  * Four letters outputs the {@linkplain TextStyle#FULL full} form of localized
 414  * offset, equivalent to four letters of Offset-O. The output will be the
 415  * corresponding localized offset text if the offset is zero. Five
 416  * letters outputs the hour, minute, with optional second if non-zero, with
 417  * colon. It outputs 'Z' if the offset is zero.
 418  * Six or more letters throws {@code IllegalArgumentException}.
 419  * <p>
 420  * <b>Optional section</b>: The optional section markers work exactly like
 421  * calling {@link DateTimeFormatterBuilder#optionalStart()} and
 422  * {@link DateTimeFormatterBuilder#optionalEnd()}.
 423  * <p>
 424  * <b>Pad modifier</b>: Modifies the pattern that immediately follows to be
 425  * padded with spaces. The pad width is determined by the number of pattern
 426  * letters. This is the same as calling
 427  * {@link DateTimeFormatterBuilder#padNext(int)}.
 428  * <p>


< prev index next >