|
50 | 50 | import java.text.SimpleDateFormat; |
51 | 51 | import java.util.Calendar; |
52 | 52 | import java.util.GregorianCalendar; |
| 53 | +import java.util.TimeZone; |
53 | 54 | import java.util.UUID; |
54 | 55 | import java.util.logging.Level; |
55 | 56 | import java.util.logging.Logger; |
@@ -132,11 +133,15 @@ private String convertToFigshareQueryDate(String indate, boolean until) throws B |
132 | 133 | String finedate = toFinestUntil(indate); |
133 | 134 | LOG.log(Level.FINER, "convertToFigshareQueryDate() finedate="+finedate); |
134 | 135 | SimpleDateFormat strFormatOut1 = new SimpleDateFormat("dd/MM/yyyy"); |
| 136 | + strFormatOut1.setTimeZone(TimeZone.getTimeZone("UTC")); |
135 | 137 | SimpleDateFormat strFormatOut2 = new SimpleDateFormat("dd/MM/yyyy'T'HH:mm:ss'Z'"); |
| 138 | + strFormatOut2.setTimeZone(TimeZone.getTimeZone("UTC")); |
136 | 139 | String formatIn1 = "yyyy-MM-dd"; |
137 | | - String formatIn2 = "yyyy-MM-dd'T'HH:mm:ss'Z'"; |
| 140 | + String formatIn2 = "yyyy-MM-dd'T'HH:mm:ssX"; |
138 | 141 | SimpleDateFormat strFormatIn1 = new SimpleDateFormat(formatIn1); |
| 142 | + strFormatIn1.setTimeZone(TimeZone.getTimeZone("UTC")); |
139 | 143 | SimpleDateFormat strFormatIn2 = new SimpleDateFormat(formatIn2); |
| 144 | + strFormatIn1.setTimeZone(TimeZone.getTimeZone("UTC")); |
140 | 145 | // Fix OAICAT setting the year to 9999, as figshare needs 2999 |
141 | 146 | if ( finedate.startsWith("9999") ) { |
142 | 147 | finedate = "2999"+finedate.substring(4); |
|
0 commit comments