@Test public void parseXep0082Date() throws Exception { Date date = XmppDateTime.parseDate("1971-07-21"); Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.setTimeZone(TimeZone.getTimeZone("GMT")); assertEquals(1971, cal.get(Calendar.YEAR)); assertEquals(6, cal.get(Calendar.MONTH)); assertEquals(21, cal.get(Calendar.DAY_OF_MONTH)); }
public static Date parseXEP0082Date(String dateString) throws ParseException { for (PatternCouplings coupling : couplings) { Matcher matcher = coupling.pattern.matcher(dateString); if (matcher.matches()) { return coupling.formatter.parse(dateString); } } return dateTimeNoMillisFormatter.parse(dateString); }
XmppDateTime { public static Date parseXEP0082Date(String dateString) throws ParseException { for (PatternCouplings coupling : couplings) { Matcher matcher = coupling.pattern.matcher(dateString); if (matcher.matches()) { return coupling.formatter.parse(dateString); } } return dateTimeNoMillisFormatter.parse(dateString); } }
XmppDateTime { public static Date parseXEP0082Date(String dateString) throws ParseException { for (PatternCouplings coupling : couplings) { Matcher matcher = coupling.pattern.matcher(dateString); if (matcher.matches()) { return coupling.formatter.parse(dateString); } } return dateTimeNoMillisFormatter.parse(dateString); }  }
XmppDateTime { public static Date parseXEP0082Date(String dateString) throws ParseException { for (PatternCouplings coupling : couplings) { Matcher matcher = coupling.pattern.matcher(dateString); if (matcher.matches()) { return coupling.formatter.parse(dateString); } } return dateTimeNoMillisFormatter.parse(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 parseXEP0082Date(String dateString) throws ParseException { for (PatternCouplings coupling : couplings) { Matcher matcher = coupling.pattern.matcher(dateString); if (matcher.matches()) { return coupling.formatter.parse(dateString); } } return dateTimeNoMillisFormatter.parse(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);  }