code: private static final long trueMonthStart(long month)
      {
          long start = cache.get(month);
  
          if (start == CalendarCache.EMPTY)
          {
              // Make a guess at when the month started, using the average length
              long origin = HIJRA_MILLIS
                          + (long)Math.floor(month * CalendarAstronomer.SYNODIC_MONTH) * ONE_DAY;
  
              double age = moonAge(origin);
  
              if (moonAge(origin) >= 0) {
                  // The month has already started
                  do {
                      origin -= ONE_DAY;
                      age = moonAge(origin);
                  } while (age >= 0);
              }
              else {
                  // Preceding month has not ended yet.
                  do {
                      origin += ONE_DAY;
                      age = moonAge(origin);
                  } while (age < 0);
              }
  
              start = (origin - HIJRA_MILLIS) / ONE_DAY + 1;
  
              cache.put(month, start);
          }
          return start;
      }
docs: Find the day number on which a particular month of the true/lunar
  Islamic calendar starts.
  
  @param month The month in question, origin 0 from the Hijri epoch
  
  @return The day number on which the given month starts.