### Question:
DateTimeUtil { public static DateTime parseUTCToDateTime(String utcDate) { DateTime isoDT = ISODateTimeFormat.dateTimeParser().withOffsetParsed() .parseDateTime(utcDate); return isoDT.withZone(DateTimeZone.forID("UTC")); }  static Date parseUTCDateToDate(String utcDate); static Date parseUTCToDate(String utcDate); static DateTime parseUTCToDateTime(String utcDate); static String formatDateToUTC(Date date); final static DateTimeFormatter utcFormatter; final static DateTimeFormatter utcYMDFormatter; }### Answer:
@Test public void utcToDateTimeTest() throws Exception { DateTime date = DateTimeUtil.parseUTCToDateTime("2001"); assertEquals(2001, date.getYear()); date = DateTimeUtil.parseUTCToDateTime("2001-05-08"); assertEquals(2001, date.getYear()); assertEquals(5, date.getMonthOfYear()); assertEquals(8, date.getDayOfMonth()); date = DateTimeUtil.parseUTCToDateTime("2002-02-01T12:13:14"); assertEquals(2002, date.getYear()); assertEquals(2, date.getMonthOfYear()); assertEquals(1, date.getDayOfMonth()); assertEquals(17, date.getHourOfDay()); assertEquals(13, date.getMinuteOfHour()); assertEquals(14, date.getSecondOfMinute()); date = DateTimeUtil.parseUTCToDateTime("2004-02-04T12:13:14.005"); assertEquals(2004, date.getYear()); assertEquals(2, date.getMonthOfYear()); assertEquals(4, date.getDayOfMonth()); assertEquals(17, date.getHourOfDay()); assertEquals(13, date.getMinuteOfHour()); assertEquals(14, date.getSecondOfMinute()); assertEquals(5, date.getMillisOfSecond()); date = DateTimeUtil.parseUTCToDateTime("2004-02-04T12:13:14+04:00"); date = date.withZone(DateTimeZone.forID("UTC")); assertEquals(2004, date.getYear()); assertEquals(2, date.getMonthOfYear()); assertEquals(4, date.getDayOfMonth()); assertEquals(8, date.getHourOfDay()); assertEquals(13, date.getMinuteOfHour()); assertEquals(14, date.getSecondOfMinute()); assertEquals(0, date.getMillisOfSecond()); date = DateTimeUtil.parseUTCToDateTime("2004-02-04T12:13:14.005Z"); assertEquals(2004, date.getYear()); assertEquals(2, date.getMonthOfYear()); assertEquals(4, date.getDayOfMonth()); assertEquals(12, date.getHourOfDay()); assertEquals(13, date.getMinuteOfHour()); assertEquals(14, date.getSecondOfMinute()); assertEquals(5, date.getMillisOfSecond()); date = DateTimeUtil.parseUTCToDateTime("2004-02-04T12:13Z"); assertEquals(2004, date.getYear()); assertEquals(2, date.getMonthOfYear()); assertEquals(4, date.getDayOfMonth()); assertEquals(12, date.getHourOfDay()); assertEquals(13, date.getMinuteOfHour()); assertEquals(0, date.getSecondOfMinute()); assertEquals(0, date.getMillisOfSecond()); try { date = DateTimeUtil.parseUTCToDateTime("not even close"); fail(); } catch (IllegalArgumentException e) { } }