Convert an Coptic/Ethiopic year, month and day to a Julian day
@param year the extended year
@param month the month
@param day the day
@return Julian day
@hide unsupported on Android
515630
public static int ceToJD(long year, int month, int day, int jdEpochOffset) {

        // Julian<->Ethiopic algorithms from:
        // "Calendars in Ethiopia", Berhanu Beyene, Manfred Kudlek, International Conference
        // of Ethiopian Studies XV, Hamburg, 2003

        // handle month > 12, < 0 (e.g. from add/set)
        if ( month >= 0 ) {
            year += month/13;
            month %= 13;
        } else {
            ++month;
            year += month/13 - 1;
            month = month%13 + 12;
        }
        return (int) (
            jdEpochOffset           // difference from Julian epoch to 1,1,1
            + 365 * year            // number of days from years
            + floorDivide(year, 4)  // extra day of leap year
            + 30 * month            // number of days from months (months are 0-based)
            + day - 1               // number of days for present month (1 based)
            );
    }
268289
public static function julianToHijri(float $julianDay)
    {
        $y = 10631.0 / 30.0;
        $epochAstro = 1948084;
        $shift1 = 8.01 / 60.0;

        $z = $julianDay - $epochAstro;
        $cyc = floor($z / 10631.0);
        $z = $z - 10631 * $cyc;
        $j = floor(($z - $shift1) / $y);
        $z = $z - floor($j * $y + $shift1);

        $year = 30 * $cyc + $j;
        $month = (int)floor(($z + 28.5001) / 29.5);
        if ($month === 13)
        {
            $month = 12;
        }

        $day = $z - floor(29.5001 * $month - 29);

        return (object) ['year' => (int) $year, 'month' => (int) $month, 'day' => (int) $day];
    }
474601
public static int dayOfYear(int year, int month, int date) {
        int leapAdjust = month > 2 && isLeapYear(year) ? 1 : 0;
        return MONTH_START_TO_DOY[month - 1] + leapAdjust + date - 1;
    }
1033771
public static function of(int $month, int $day) : MonthDay
    {
        Field\MonthOfYear::check($month);
        Field\DayOfMonth::check($day, $month);

        return new MonthDay($month, $day);
    }
358508
public static long toMJD(GregorianDate date) {

        return GregorianMath.toMJD(date.getYear(), date.getMonth(), date.getDayOfMonth());

    }
897903
public function setDate($year, $month, $day)
    {
        return parent::setDate(self::$yearMustAlwaysBe, self::$monthMustAlwaysBe, self::$dayMustAlwaysBe);
    }
512058
def daysInMonth(self, month, year):
        
        result = None
        debug and log.debug('daysInMonth(%s, %s)', month, year)
        if month > 0 and month <= 12:
            result = self._DaysInMonthList[month - 1]

            if month == 2:
                if year in self._leapYears:
                    result += 1
                else:
                    if calendar.isleap(year):
                        self._leapYears.append(year)
                        result += 1

        return result
142320
public function ymdToJd($year, $month, $day)
    {
        if ($month < 1 || $month > $this->monthsInYear()) {
            throw new InvalidArgumentException('Month ' . $month . ' is invalid for this calendar');
        }

        if ($year < 0) {
            // 1 BCE is 0, 2 BCE is -1, etc.
            ++$year;
        }
        $a     = (int) ((14 - $month) / 12);
        $year  = $year + 4800 - $a;
        $month = $month + 12 * $a - 3;

        return $day + (int) ((153 * $month + 2) / 5) + 365 * $year + (int) ($year / 4) - (int) ($year / 100) + (int) ($year / 400) - 32045;
    }
1098302
public void setDate(int day, int month, int year){
        if(mAdapter.getYear() == year && mAdapter.getMonth() == month && mAdapter.getDay() == day)
            return;

        mAdapter.setDate(day, month, year, false);
        goTo(month, year);
    }
8783
public XMLGregorianCalendar newGMonthDay(int month, int day) {
        XMLGregorianCalendar cal=dataFactory.newXMLGregorianCalendar();
        cal.setMonth(month);
        cal.setDay(day);
        return cal;
    }
1368379
public function getAge($day, $month, $year) {
        $years = date('Y') - $year;
        if (date('m') < $month)
            $years--;
        elseif (date('d') < $day && date('m') == $month)
            $years--;

        return $years;
    }
1328745
private function isDateValid(int $year, int $month, int $day) : bool
    {
        if ($day === 0) {
            return false;
        }

        switch ($month) {
            case 2:
                $days = $this->isLeapYear($year) ? 29 : 28;
                break;

            case 4:
            case 6:
            case 9:
            case 11:
                $days = 30;
                break;

            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                $days = 31;
                break;

            default:
                return false;
        }

        return $day <= $days;
    }
155345
public function setDate($year, $month, $day)
    {
      // Validate
      self::validateDate($year, $month, $day);
      
      // Set internal year, month and day variables
      $this->year  = (int)$year;
      $this->month = (int)$month;
      $this->day   = (int)$day;
    }
429759
def hdate_to_jdn(date):
    
    day = date.day
    month = date.month
    if date.month == 13:
        month = 6
    if date.month == 14:
        month = 6
        day += 30

    # Calculate days since 1,1,3744
    day = _days_from_3744(date.year) + (59 * (month - 1) + 1) // 2 + day

    # length of year
    length_of_year = get_size_of_hebrew_year(date.year)
    # Special cases for this year
    if length_of_year % 10 > 4 and month > 2:  # long Heshvan
        day += 1
    if length_of_year % 10 < 4 and month > 3:  # short Kislev
        day -= 1
    if length_of_year > 365 and month > 6:  # leap year
        day += 30

    # adjust to julian
    return day + 1715118
527480
private boolean setDate(String day, String month, String year) {
        click();
        String fullDate = monthYearButton.getText().trim();
        if (!fullDate.contains(month) || !fullDate.contains(year)) {
            monthYearButton.click();
            goToYear(year, fullDate);
            WebLocator yearEl = new WebLocator(yearContainer).setText(year, SearchType.EQUALS).setInfoMessage("year " + year);
            yearEl.click();
            WebLocator yearContainer1 = new WebLocator(yearAndMonth).setClasses("x-date-mp-year", "x-date-mp-sel");
            WebLocator yearEl1 = new WebLocator(yearContainer1).setText(year, SearchType.EQUALS);
            if (!yearEl1.ready(1)) {
                yearEl.click();
            }
            WebLocator monthEl = new WebLocator(monthContainer).setText(month, SearchType.EQUALS).setInfoMessage("month " + month);
            monthEl.click();
            selectOkButton.click();
        }
        WebLocator dayEl = new WebLocator(dayContainer).setText(day, SearchType.EQUALS).setInfoMessage("day " + day);
        dayEl.click();
        return true;
    }
274583
public function setDate($year, $month, $day)
    {
        try {
            $this->getDateObject()->setDate($year, $month, $day);
        } catch (\Exception $e) {
            throw new DateTimeObjectException($e->getMessage());
        }

        return $this;
    }
253042
private static Date getDate(int day, int month, int year) {
		Calendar cal = Calendar.getInstance();
		cal.set(Calendar.YEAR, year);
		cal.set(Calendar.MONTH, month);
		cal.set(Calendar.DATE, day);
		return cal.getTime();
	}