[
https://issues.apache.org/jira/browse/LANG-1637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17257133#comment-17257133
]
Gary D. Gregory commented on LANG-1637:
---------------------------------------
{quote}Javadoc cites for the year pattern: _For formatting, if the number of
pattern letters is 2, the year is truncated to 2 digits; otherwise it is
interpreted as a number._ Starting with Java 1.7 a pattern of 'Y' or 'YYY' will
be formatted as '2003', while it was '03' in former Java versions.
FastDateFormat implements the behavior of Java 7.
{quote}
> FastDatePrinter formatting using YY pattern yields junk digits
> --------------------------------------------------------------
>
> Key: LANG-1637
> URL: https://issues.apache.org/jira/browse/LANG-1637
> Project: Commons Lang
> Issue Type: Bug
> Affects Versions: 3.11
> Reporter: Uri Gonen
> Priority: Minor
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> {code:java}
> final GregorianCalendar cal = new GregorianCalendar(2020, 12, 31, 0, 0, 0);
> final DatePrinter printer2Digits = getInstance("YY");
> assertEquals("21", printer2Digits.format(cal));
> {code}
> the above test fails
--
This message was sent by Atlassian Jira
(v8.3.4#803005)