Using Sun Java 1.5.0_11:

final SimpleDateFormat almostXsDateTime=new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
System.out.println("One: "+almostXsDateTime.format(c));
c.set(GregorianCalendar.HOUR_OF_DAY, copy.get(GregorianCalendar.HOUR_OF_DAY));
System.out.println("Two: "+almostXsDateTime.format(c));

IMHO, the get/set combo shouldn’t be changing the date… but:

One: 2007-05-17T00:00:00.000+0200
Two: 2007-05-17T02:00:00.000+0200

(I’m not yet sure under which exact cirumstances this happens; it doesn’t happen always…)

P.S. the format is called “almost XSDateTime”, because it’s just almost XML Schemas DateTime format. Unfortunately, the Java date parsing and writing classes can’t handle XML Schema DateTime (or ISO 8601) because of a tiny little detail: they use a colon in their timezone offset. How annoying is that, that java can just almost handle this ISO date format?

P.P.S. so apparently Java is adding the ZONE_OFFSET to the date in this situation; it likely is related to locales and timezones.