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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low (View bug fix roadmap)
    • None
    • 4.0, 4.0.1, 6.2.4, 7.5.0
    • Issue - Fields

      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

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

            [JRASERVER-20007] Default date format is two-digit and loses century chosen in calendar picker

            In Jira clould I think I've changed the settings available and this still happens to people all the time when they create sprints. Our burndowns and some other reports are junked by people making this mistake an not noticing.  Can you tell me if there is anything below I have wrong or that could fix it? Or is there another way in cloud to set jira-application.properties?

            Steve McAfee added a comment - In Jira clould I think I've changed the settings available and this still happens to people all the time when they create sprints. Our burndowns and some other reports are junked by people making this mistake an not noticing.  Can you tell me if there is anything below I have wrong or that could fix it? Or is there another way in cloud to set jira-application.properties?

            So the bug is that the default date format is two-digit. The date picker allows you to choose an unambiguous date but all that does is renders the date into the configured format which could be two digit resulting lost information about the century.

            For a workaround you can change the date format yourself.

            The date format used can be changed in the jira-application.properties files as described here:

            http://confluence.atlassian.com/display/JIRA/Changing+the+Due+Date+input+format

            Chris Mountford added a comment - So the bug is that the default date format is two-digit. The date picker allows you to choose an unambiguous date but all that does is renders the date into the configured format which could be two digit resulting lost information about the century. For a workaround you can change the date format yourself. The date format used can be changed in the jira-application.properties files as described here: http://confluence.atlassian.com/display/JIRA/Changing+the+Due+Date+input+format

              Unassigned Unassigned
              115f91e91931 Daniel Ray
              Affected customers:
              16 This affects my team
              Watchers:
              12 Start watching this issue

                Created:
                Updated: