You are here

function DatexHejri::jd_to_islamic in Datex 7.2

* 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 DatexHejri::jd_to_islamic()
DatexHejri::hj_convert in datex_api/DatexHejri.inc
* Islamic Calendar *

File

datex_api/DatexHejri.inc, line 91

Class

DatexHejri
@author Sina Salek

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,
  );
}