Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-20007

Default date format is two-digit and loses century chosen in calendar picker

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 4.0, 4.0.1, 6.2.4, 7.5.0
    • Issue - Fields

    Description

      The date picker allows you to choose a date like 2040 but by default this will be set as a date with a two digit year which causes it to be interpreted as 1940 as per the century selection algorithm for two digit years in Java's SimpleDateFormat.

      Problem Description:

      Client Due Date: 31-Dec-1940
      Expected Completion Date: 16-Dec-1932

      Both were set to 20XX not 19XX

      This is related to a Java date bug.

      From Atlassian support from ticket JSP-49395:
      Weird, but I also came across that this is in the design. Java just assumes that if you are using 2 digits for the date it falls somewhere between 80 years before and 20 years after the date it was created.

      For parsing with the abbreviated year pattern ("y" or "yy"), SimpleDateFormat must interpret the abbreviated year relative to some century. It does this by adjusting dates to be within 80 years before and 20 years after the time the SimpleDateFormat instance is created. For example, using a pattern of "MM/dd/yy" and a SimpleDateFormat instance created on Jan 1, 1997, the string "01/11/12" would be interpreted as Jan 11, 2012 while the string "05/04/64" would be interpreted as May 4, 1964.

      http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html

      Attachments

        1. yk2_bug_1.JPG
          yk2_bug_1.JPG
          23 kB
        2. yk2_bug_2.JPG
          yk2_bug_2.JPG
          16 kB
        3. yk2_bug_3.JPG
          yk2_bug_3.JPG
          26 kB
        4. yk2_bug_4.JPG
          yk2_bug_4.JPG
          19 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              115f91e91931 Daniel Ray
              Votes:
              15 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated: