code: public Date toDate(double x) {
          if (Double.isNaN(x)) {
              return null;
          }
  
          return new Date(Double.doubleToRawLongBits(x));
      }
docs: Retruns the date object from internal double encoding.
  @param x the date in double encoding.