Skip to content

Instantly share code, notes, and snippets.

@jgcasta
Last active August 29, 2015 13:55
Show Gist options
  • Save jgcasta/8781116 to your computer and use it in GitHub Desktop.
Save jgcasta/8781116 to your computer and use it in GitHub Desktop.
Return a String date with format dd-MM-yyyy from a XMLGregorianCalendar
/**
* Return a String date with format dd-MM-yyyy from a XMLGregorianCalendar
*
* @param cal
* @return
*/
public String XmlGregorianCalendar2String(XMLGregorianCalendar cal){
String str = "";
SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy");
str = format.format(cal.toGregorianCalendar().getTime());
return str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment