Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-107

FastDateFormat year bug

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bayard Henri Yandell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: