@Test public void testLeapSeconds() throws ParseException { Date date = XmppDateTime.parseXEP0082Date("2015-07-31T23:59:60Z"); Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.setTimeZone(TimeZone.getTimeZone("GMT")); assertEquals(0, cal.get(Calendar.SECOND)); }
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);  }