public static String convertDateToISO8601(Date date){
  DateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
  return dateFormat.format(date);
}

public static String convertDateToISO8601 ( Date date ) { DateFormat dateFormat = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss" ) ; return dateFormat . format ( date ) ; }
method that converts a java date to an iso 8601 string
