code: public static java.util.Date toDateTime(Object value) throws ParseException {
          if (value == null) {
              return null;
          }
          if (value instanceof java.util.Date) {
              return (java.util.Date) value;
          }
          if (value instanceof String) {
              if ("".equals((String) value)) {
                  return null;
              }
              return IN_DATETIME_FORMAT.parse((String) value);
          }
  
          return IN_DATETIME_FORMAT.parse(value.toString());
      }
docs: Convert an Object to a DateTime.