code: public static long toMJD(
          int year,
          int month,
          int dayOfMonth
      ) {
  
          checkDate(year, month, dayOfMonth);
  
          long y = year;
          int m = month;
  
          if (m < 3) {
              y--;
              m += 12;
          }
  
          long days = (
              (y * 365)
              + Math.floorDiv(y, 4)
              + (((m + 1) * 153) / 5) - 123
              + dayOfMonth
          );
  
          if ((year >= 1901) && (year < 2100)) {
              days -= 15;
          } else {
              days = days - Math.floorDiv(y, 100) + Math.floorDiv(y, 400);
          }
  
          return days - OFFSET;
  
      }
docs: /*[deutsch]
  <p>Ermittelt das modifizierte julianische Datum. </p>
  
  @param   year        proleptic iso year [(-999999999) - 999999999]
  @param   month       gregorian month (1-12)
  @param   dayOfMonth  day of month in range (1-31)
  @return  days since [1858-11-17] (modified Julian date)
  @throws  IllegalArgumentException if any argument is out of range