RdfFormatter { public String toXsdDate(Date date) { final StringBuilder dateAsString = new StringBuilder(25); dateAsString.append(dateFormat.format(date)); dateAsString.append("T"); dateAsString.append(timeFormat.format(date)); return dateAsString.toString(); } RdfFormatter(); String toXsdDate(Date date);  }
@Test public void testXsdDate() { GregorianCalendar calendar = new GregorianCalendar(); calendar.set(2010, 2, 30, 19, 30, 14); calendar.set(Calendar.MILLISECOND, 856); RdfFormatter format = new RdfFormatter(); Assert.assertEquals("2010-03-30T19:30:14.856", format.toXsdDate(calendar.getTime())); }