code: public static double dateTime2gps( double dateTimeMillis ) {
          dateTimeMillis = dateTimeMillis / 1000;
          double ipart = Math.floor(dateTimeMillis);
          double fpart = dateTimeMillis % 1;
          double gpsTime = ipart - 315964800;
          if (isunixtimeleap(Math.ceil(dateTimeMillis))) {
              fpart *= 2;
          }
          return gpsTime + fpart + countleaps(gpsTime, true);
      }
docs: Convert {@link DateTime} to GPS Time.
  
  @param dateTimeMillis the datetime to convert (millis).
  @return the gps time.