@Test
public void testDate() throws ParseException {

    // Create the parser
    XsDateTimeFormat format = new XsDateTimeFormat();
    // Set a date
    String time = "2014-10-12T09:00:00.000Z";
    // Parse the Date
    Object parseObject = format.parseObject(time);
    assertTrue(parseObject instanceof Calendar);
    // Get the date
    Calendar cal = (Calendar) parseObject;
    // Ensure the parsing is correct
    int year = cal.get(Calendar.YEAR);
    int month = cal.get(Calendar.MONTH);
    int day = cal.get(Calendar.DAY_OF_MONTH);
    int hours = cal.get(Calendar.HOUR);
    int mins = cal.get(Calendar.MINUTE);
    int sec = cal.get(Calendar.SECOND);
    int millis = cal.get(Calendar.MILLISECOND);
    // check
    assertEquals(year, 2014);
    assertEquals(month, 9);
    assertEquals(day, 12);
    assertEquals(hours, 9);
    assertEquals(mins, 0);
    assertEquals(sec, 0);
    assertEquals(millis, 0);
}