DateTimeUtils { public static String calendarToXSDDateTimeString(Calendar cal) { DateTimeFormatter fmt = hasZeroMilliSeconds(cal) ? dateTimeFmt_XSD_ms0 : dateTimeFmt_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 testCalendarToXSDDateTimeString_1() { Calendar cal = createCalendar(1984, Calendar.MARCH, 22, 14, 32, 1, 0, "Z") ; assertEquals("1984-03-22T14:32:01+00:00", DateTimeUtils.calendarToXSDDateTimeString(cal)); cal.setTimeZone(TimeZone.getTimeZone("MST")); assertEquals("1984-03-22T07:32:01-07:00", DateTimeUtils.calendarToXSDDateTimeString(cal)); }
@Test public void testCalendarToXSDDateTimeString_2() { Calendar cal = createCalendar(1984, Calendar.MARCH, 22, 14, 32, 1, 50, "Z") ; assertEquals("1984-03-22T14:32:01.050+00:00", DateTimeUtils.calendarToXSDDateTimeString(cal)); cal.setTimeZone(TimeZone.getTimeZone("MST")); assertEquals("1984-03-22T07:32:01.050-07:00", DateTimeUtils.calendarToXSDDateTimeString(cal)); }