commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31181] New: - FastDateFormat year bug
Date Sun, 12 Sep 2004 05:10:52 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31181>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31181

FastDateFormat year bug

           Summary: FastDateFormat year bug
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Lang
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: bayard@apache.org


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.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message