Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Operating System: other
Platform: Other
-
31181
Description
Jerson Chua reports in an email entitled: "FastDateFormat year bug "
I used FastDateFormat to convert a date object to string using this pattern yyyy-MM-dd.
No zeros are padded if I my year is 0001. Iâm getting 1-01-01.
After looking through the code, I replaced line 498
rule = UnpaddedNumberField.INSTANCE_YEAR;
to
rule = selectNumberRule(Calendar.YEAR, tokenLen);
And it fixed the problem.