DateTimeUtils { public static String calendarToXSDTimeString(Calendar cal) { DateTimeFormatter fmt = hasZeroMilliSeconds(cal) ? timeFmt_XSD_ms0 : timeFmt_XSD_ms ; return calendarToXSDString(cal, fmt) ; }  static String nowAsXSDDateTimeString(); static String todayAsXSDDateString(); static String nowAsString(); static String nowAsString(String formatString); static String nowAsString(DateTimeFormatter dateFormat); static String calendarToXSDDateTimeString(Calendar cal); static String calendarToXSDDateString(Calendar cal); static String calendarToXSDTimeString(Calendar cal);  }
@Test public void testCalendarToXSDTimeString_1() { Calendar cal = createCalendar(1984, Calendar.MARCH, 22, 14, 32, 1, 0, "GMT+01:00"); assertEquals("14:32:01+01:00", DateTimeUtils.calendarToXSDTimeString(cal)); cal.setTimeZone(TimeZone.getTimeZone("MST")); assertEquals("06:32:01-07:00", DateTimeUtils.calendarToXSDTimeString(cal)); }
@Test public void testCalendarToXSDTimeString_2() { Calendar cal = createCalendar(1984, Calendar.MARCH, 22, 14, 32, 1, 500, "GMT+01:00"); assertEquals("14:32:01.500+01:00", DateTimeUtils.calendarToXSDTimeString(cal)); cal.setTimeZone(TimeZone.getTimeZone("MST")); assertEquals("06:32:01.500-07:00", DateTimeUtils.calendarToXSDTimeString(cal)); }