Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-2546

OAI-PMH interface is parsing Dates incorrectly

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0, 5.1
    • Fix Version/s: 5.2
    • Component/s: None
    • Attachments:
      0
    • Comments:
      2
    • Documentation Status:
      Not Required

      Description

      The class org.dspace.xoai.util.DateUtils formats a Date to a String and vice versa. During formating it adds milliseconds to the String but the parser currently isn't able to parse it back to the original Date.
      Try this peace of code in the DateUtils class to see the problem:

      public static void main(String[] args)
      {
      Date date = new Date();
      String formatted = "";

      for(int i = 0; i<10; i++)

      { formatted = format(date, true); System.out.println(formatted); date = parse(formatted); }

      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hardyoyo Hardy Pottinger
                Reporter:
                christian.scheible Christian Scheible
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: