code: private String getFormattedDate(Date date) {
  		String formattedDate = "";
  		Calendar cal = Calendar.getInstance();
  		cal.setTime(date);
  		try {
  			formattedDate = ValueFactoryImpl.getInstance().createValue(cal).getString();
  		} catch (Exception e) {
  			// should never happen
  			e.printStackTrace();
  		}
  		return formattedDate;
  	}
docs: 2012-01-04T23:59:59.999+02:00