im building JAXWS client , one of the methods get XMLGregorianCalendar .
now i need to format this data 2011-11-06T14:34:16.679+02:00
to be set into XMLGregorian
You can parse the date string into an java.util.Date object using follow method:
String strDate = "2011-11-06T14:34:16.679+02:00";
strDate = strDate.substring(0, 26) + strDate.substring(27, 29);
String pattern = "yyyy-MM-dd'T'hh:mm:ss.SSSZ";
SimpleDateFormat sdFormat = new SimpleDateFormat(pattern);
Date d = sdFormat.parse(strDate);
Then set this Date into your XMLGregorianCalendarj