@Test public void parseXep0082TimeWithMillis() throws Exception { Date date = XmppDateTime.parseDate("02:56:15.123"); Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.setTimeZone(TimeZone.getTimeZone("GMT")); assertEquals(2, cal.get(Calendar.HOUR_OF_DAY)); assertEquals(56, cal.get(Calendar.MINUTE)); assertEquals(15, cal.get(Calendar.SECOND)); assertEquals(123, cal.get(Calendar.MILLISECOND)); }
public static Date parseDate(String dateString) throws ParseException { Matcher matcher = xep0091Pattern.matcher(dateString); if (matcher.matches()) { int length = dateString.split("T")[0].length(); if (length < 8) { Date date = handleDateWithMissingLeadingZeros(dateString, length); if (date != null) return date; } else { return xep0091Formatter.get().parse(dateString); } } return parseXEP0082Date(dateString); }
XmppDateTime { public static Date parseDate(String dateString) throws ParseException { Matcher matcher = xep0091Pattern.matcher(dateString); if (matcher.matches()) { int length = dateString.split("T")[0].length(); if (length < 8) { Date date = handleDateWithMissingLeadingZeros(dateString, length); if (date != null) return date; } else { return xep0091Formatter.get().parse(dateString); } } return parseXEP0082Date(dateString); } }
XmppDateTime { public static Date parseDate(String dateString) throws ParseException { Matcher matcher = xep0091Pattern.matcher(dateString); if (matcher.matches()) { int length = dateString.split("T")[0].length(); if (length < 8) { Date date = handleDateWithMissingLeadingZeros(dateString, length); if (date != null) return date; } else { return xep0091Formatter.get().parse(dateString); } } return parseXEP0082Date(dateString); }  }
XmppDateTime { public static Date parseDate(String dateString) throws ParseException { Matcher matcher = xep0091Pattern.matcher(dateString); if (matcher.matches()) { int length = dateString.split("T")[0].length(); if (length < 8) { Date date = handleDateWithMissingLeadingZeros(dateString, length); if (date != null) return date; } else { return xep0091Formatter.get().parse(dateString); } } return parseXEP0082Date(dateString); }  static Date parseXEP0082Date(String dateString); static Date parseDate(String dateString); static String formatXEP0082Date(Date date); static String convertXep82TimezoneToRfc822(String dateString); static String convertRfc822TimezoneToXep82(String dateString); static String asString(TimeZone timeZone); }
XmppDateTime { public static Date parseDate(String dateString) throws ParseException { Matcher matcher = xep0091Pattern.matcher(dateString); if (matcher.matches()) { int length = dateString.split("T")[0].length(); if (length < 8) { Date date = handleDateWithMissingLeadingZeros(dateString, length); if (date != null) return date; } else { return xep0091Formatter.get().parse(dateString); } } return parseXEP0082Date(dateString); }  static Date parseXEP0082Date(String dateString); static Date parseDate(String dateString); static String formatXEP0082Date(Date date); static String convertXep82TimezoneToRfc822(String dateString); static String convertRfc822TimezoneToXep82(String dateString); static String asString(TimeZone timeZone);  }