Sentinel2Utils { public static String getFormattedTimeString(final String rawTimeString) { Date date = null; String formattedDate = ""; final String RAW_TIME_STRING_TEMPLATE = "yyyyMMdd'T'HHmmss"; logger.debug("(getFormattedTimeString)(rawTimeString:" + rawTimeString + ")|start"); try { date = new SimpleDateFormat(RAW_TIME_STRING_TEMPLATE).parse(rawTimeString); } catch (final Exception ex) { logger.warn("Sentinel-2 ingestion: Date format wrong; error message: " + ex.getMessage()); } if (date != null) { formattedDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(date); } logger.debug("(getFormattedTimeString) return:" + formattedDate + "|end"); return formattedDate; } private  Sentinel2Utils(); static String xYZpoints2GML(final String pointsString); static String xYZpoints2JTS(final String pointsString); static String xYPoints2GML(final String pointsString); static String xYPoints2JTS(final String pointsString); static String getEndPositionByStart(final String startTime); static String getSatelliteByProductName(final String productName); static String filterUselessZeros(final String integer); static String getAbsoluteOrbitFromDatatakeFilename(
         final String datatakeFileName); static String getFormattedTimeString(final String rawTimeString); static String formatNumber(double value); static final String DATE_TIME_FORMAT; static final long SENSING_TIME; }
@Test public void testGetFormattedTimeString() throws Exception { final String rawTime = "20091211T165928"; final String expected = "2009-12-11T16:59:28.000Z"; final String time = Sentinel2Utils.getFormattedTimeString(rawTime); Assert.assertEquals(expected, time); }