Format SOAP Date in Java
October 18, 2010
I needed to manually generate some XML containing a Date, from Java. Here's the code I needed to format the date correctly for a SOAP Message:
String lFormatTemplate = "yyyy-MM-dd'T'hh:mm:ss'Z'"; DateFormat lDateFormat = new SimpleDateFormat(lFormatTemplate); String lDate = lDateFormat.format(lDateToReturn); return lDate …