code: public static int jodaToCalciteDate(final DateTime dateTime, final DateTimeZone timeZone)
    {
      final DateTime date = dateTime.withZone(timeZone).dayOfMonth().roundFloorCopy();
      return Days.daysBetween(DateTimes.EPOCH, date.withZoneRetainFields(DateTimeZone.UTC)).getDays();
    }
docs: Calcite expects "DATE" types to be number of days from the epoch to the UTC date matching the local time fields.
  
  @param dateTime joda timestamp
  @param timeZone session time zone
  
  @return Calcite style date