DatetimeHelper { public static Date stringToDate(String dateText) throws ParseException { SimpleDateFormat formatter = new SimpleDateFormat(ISO_DATE_FORMAT); formatter.setTimeZone(TimeZone.getTimeZone("GMT")); return formatter.parse(dateText); }  static long getTimestamp(); static String dateToString(Date date); static Date stringToDate(String dateText); static String dateToShortReadableString(Context context, Date date); static String convertSecondsToReadableDuration(long totalMilliseconds); static String convertSecondsToDuration(long totalMilliseconds); static String formatRFC822Date(Date date);  }
@Test public void stringToDateTest() throws ParseException { Date date = DatetimeHelper.stringToDate("1970-01-01T00:00:00.0Z"); assertEquals(date.getTime(), 0); }