code: public static Timestamp of(Date date) {
          if (date == null)
              return null;
          long time = date.getTime();
          int nanoSec = (int) (time % 1000) * 1000000;
          long epochSec = (time / 1000);
          return createWithCarry(epochSec, nanoSec);
      }
docs: Converts a {@link java.util.Date} to a timestamp. Date is accurate to
  milliseconds, so the last 6 digits are always going to be zeros.
  
  @param date the date to convert
  @return a new timestamp