@@ -164,7 +164,6 @@ public static List<OptionDesc> findSamplingProtocols(String langCode, String con
164164 List <String > values = CommonConfiguration .getIndexedPropertyValues ("samplingProtocol" ,
165165 context );
166166 List <OptionDesc > list = new ArrayList <OptionDesc >();
167-
168167 int valuesSize = values .size ();
169168
170169 for (int i = 0 ; i < valuesSize ; i ++) {
@@ -597,7 +596,7 @@ public static Double getDecimalCoordFromString(String latOrLong) {
597596 return null ;
598597 }
599598
600- //GPS Longitude: "-69.0° 22.0' 45.62999999998169"",
599+ // GPS Longitude: "-69.0° 22.0' 45.62999999998169"",
601600 public static Double latlonDMStoDD (String dms ) {
602601 String [] d = dms .split (" +" );
603602
@@ -1120,7 +1119,7 @@ public static JSONObject copy(JSONObject original) {
11201119 public static long getVersionFromModified (final String modified ) {
11211120 if (!stringExists (modified )) return 0 ;
11221121 try {
1123- String iso8601 = getISO8601Date (modified );
1122+ String iso8601 = roundISO8601toMillis ( getISO8601Date (modified ) );
11241123 if (iso8601 == null ) return 0 ;
11251124 // switching from DateTimeFormatter to DateTime here because the math seems to line up with how psql does it -jon
11261125 return new DateTime (iso8601 ).getMillis ();
@@ -1130,6 +1129,15 @@ public static long getVersionFromModified(final String modified) {
11301129 }
11311130 }
11321131
1132+ public static String roundISO8601toMillis (final String input ) {
1133+ if ((input == null ) || (input .length () < 24 )) return input ;
1134+ try {
1135+ float seconds = Float .parseFloat (input .substring (17 )) + 0.0005f ;
1136+ return input .substring (0 , 17 ) + String .valueOf (seconds ).substring (0 , 6 );
1137+ } catch (Exception ex ) {}
1138+ return input ;
1139+ }
1140+
11331141 // note: this respect user.receiveEmails - you have been warned
11341142 public static Set <String > getUserEmailAddresses (List <User > users ) {
11351143 Set <String > addrs = new HashSet <String >();
@@ -1145,7 +1153,6 @@ public static Set<String> getUserEmailAddresses(List<User> users) {
11451153 public static String getISO8601Date (final String date ) {
11461154 if (date == null ) return null ;
11471155 String iso8601 = date .replace (" " , "T" );
1148-
11491156 if (iso8601 .length () == 10 ) iso8601 += "T00:00:00" ;
11501157 // TODO: better testing of date's string format (or transition to date format support?)
11511158 if (iso8601 .length () < 16 ) return null ;
0 commit comments