CSVParse { static long parseFlySightDate(@NonNull String dateString) throws ParseException { if (df == null) { df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US); df.setTimeZone(TimeZone.getTimeZone("UTC")); } long millis = 0; final int len = dateString.length(); if (dateString.charAt(len - 4) == '.') { millis = 10 * Long.parseLong(dateString.substring(len - 3, len - 1)); } return df.parse(dateString).getTime() + millis; }  static double getColumnDouble(@NonNull String[] row, @NonNull CSVHeader columns, @NonNull String columnName); static long getColumnLong(@NonNull String[] row, @NonNull CSVHeader columns, @NonNull String columnName); static long getColumnDate(@NonNull String[] row, @NonNull CSVHeader columns, @NonNull String columnName); @NonNull static String getColumnString(@NonNull String[] row, @NonNull CSVHeader columns, @NonNull String columnName); static boolean getColumnYes(@NonNull String[] row, @NonNull CSVHeader columns, @NonNull String columnName);  }
@Test public void parseFlySightDateTest() throws Exception { long millis = 1517000000400L; String str = "2018-01-26T20:53:20.40Z"; long parsed = CSVParse.parseFlySightDate(str); assertEquals(millis, parsed); }