code: public static int dateToInternal(java.sql.Date date, TimeZone tz) {
  		long ts = date.getTime() + tz.getOffset(date.getTime());
  		return (int) (ts / MILLIS_PER_DAY);
  	}
docs: Converts the Java type used for UDF parameters of SQL DATE type
  ({@link java.sql.Date}) to internal representation (int).
  
  <p>Converse of {@link #internalToDate(int)}.