You are here

function cmfcCalendarV1Arabic::jd_to_islamic in Calendar Systems 8.2

Same name and namespace in other branches
  1. 8 calendar/v1/calendarSystems/arabic.class.inc.php \cmfcCalendarV1Arabic::jd_to_islamic()
  2. 6.3 calendar/v1/calendarSystems/arabic.class.inc.php \cmfcCalendarV1Arabic::jd_to_islamic()
  3. 6 calendar/v1/calendarSystems/arabic.class.inc.php \cmfcCalendarV1Arabic::jd_to_islamic()
  4. 7.3 calendar/v1/calendarSystems/arabic.class.inc.php \cmfcCalendarV1Arabic::jd_to_islamic()
  5. 7 calendar/v1/calendarSystems/arabic.class.inc.php \cmfcCalendarV1Arabic::jd_to_islamic()
  6. 7.2 calendar/v1/calendarSystems/arabic.class.inc.php \cmfcCalendarV1Arabic::jd_to_islamic()

* Islamic Calendar *

Parameters

Integer jd Julian day: * @desc jd_to_islamic will convert given Julian day into Hegri date (Islamic calendar) * @author Khaled Al-Shamaa

Return value

Array Hegri date [int Year, int Month, int Day] (Islamic calendar) *

1 call to cmfcCalendarV1Arabic::jd_to_islamic()
cmfcCalendarV1Arabic::hj_convert in calendar/v1/calendarSystems/arabic.class.inc.php
* Islamic Calendar *

File

calendar/v1/calendarSystems/arabic.class.inc.php, line 426

Class

cmfcCalendarV1Arabic

Code

function jd_to_islamic($jd) {
  $jd = floor($jd) + 0.5;
  $year = floor((30 * ($jd - $this->_islamicEpoch) + 10646) / 10631);
  $month = min(12, ceil(($jd - (29 + $this
    ->islamic_to_jd($year, 1, 1))) / 29.5) + 1);
  $day = $jd - $this
    ->islamic_to_jd($year, $month, 1) + 1;
  return array(
    $year,
    $month,
    $day,
  );
}