code: public static java.sql.Date internalToDate(int v, TimeZone tz) {
  		// note that, in this case, can't handle Daylight Saving Time
  		final long t = v * MILLIS_PER_DAY;
  		return new java.sql.Date(t - tz.getOffset(t));
  	}
docs: Converts the internal representation of a SQL DATE (int) to the Java
  type used for UDF parameters ({@link java.sql.Date}) with the given TimeZone.
  
  <p>The internal int represents the days since January 1, 1970. When we convert it
  to {@link java.sql.Date} (time milliseconds since January 1, 1970, 00:00:00 GMT),
  we need a TimeZone.