public final static byte[] encodeDate(java.util.Date d) { datetime dt = new datetime(d); return dt.toDateBytes();
public final static java.sql.Date encodeDate(java.sql.Date d, Calendar cal) { if (cal == null) { return (d); } else { cal.setTime(d); return new java.sql.Date(cal.getTime().getTime()); }
    public final static byte[] encodeDate(java.util.Date d) {        datetime dt = new datetime(d);        return dt.toDateBytes();    }