Project

General

Profile

« Previous | Next » 

Revision 5643

Added by berkley about 14 years ago

added milliseconds back onto date format

View differences:

src/edu/ucsb/nceas/metacat/dataone/CrudService.java
102 102
    
103 103
    private String metacatUrl;
104 104
    
105
    private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ");
105
    private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SZ");
106 106

  
107 107
    /**
108 108
     * singleton accessor
......
680 680
              Date dateSysMetadataModified = null;
681 681
              if(dateSMM != null)
682 682
              {
683
                  //dateSysMetadataModified = parseDate(dateSMM);
683

  
684
                  /*                  
684 685
                  if(dateSMM.indexOf(".") != -1)
685 686
                  {  //strip the milliseconds
686 687
                      //TODO: don't do this. we need milliseconds now.
687 688
                      //TODO: explore ISO 8601 to figure out milliseconds
688 689
                      dateSMM = dateSMM.substring(0, dateSMM.indexOf(".")) + 'Z';
689 690
                  }
691
                  */
690 692
                  //System.out.println("dateSMM: " + dateSMM);
691 693
                  //dateFormat.setTimeZone(TimeZone.getTimeZone("GMT-0"));
692 694
                  try
......
695 697
                  }
696 698
                  catch(java.text.ParseException pe)
697 699
                  {   //try another legacy format
698
                      DateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss'Z'");
700
                      DateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.S'Z'");
699 701
                      dateFormat2.setTimeZone(TimeZone.getTimeZone("GMT-0"));
700 702
                      dateSysMetadataModified = dateFormat2.parse(dateSMM);
701 703
                  }                  

Also available in: Unified diff