code: private Date timestampToDate(Timestamp ts) {
      long millis = ts.getTime();
      int nanos = ts.getNanos();
      return new Date(millis / 1000 * 1000 + nanos / 1000000);
    }
docs: Make sure the Timestamp will return getTime() accurate to the millisecond
  (if possible) and truncate away nanoseconds.