code: private Date convertDate(final Object data) {
  		if (data == null) {
  			return null;
  		} else if (data instanceof Date) {
  			return (Date) data;
  		} else if (data instanceof Long) {
  			return new Date((Long) data);
  		} else if (data instanceof Calendar) {
  			return ((Calendar) data).getTime();
  		} else if (data instanceof String) {
  			try {
  				SimpleDateFormat sdf = new SimpleDateFormat(INTERNAL_DATE_FORMAT);
  				sdf.setLenient(lenient);
  				return sdf.parse((String) data);
  			} catch (ParseException e) {
  				throw new SystemException("Could not convert String data [" + data + "] to a date.");
  			}
  		}
  
  		throw new SystemException("Cannot convert data type " + data.getClass() + " to a date.");
  	}
docs: Attempts to convert the given object to a date. Throws a SystemException on error.
  
  @param data the data to convert.
  @return the converted date, or null if <code>data</code> was null/empty.