//دالة التاريخ الهجري
function Hijri($GetDateFormat)
{
$TDays=round(strtotime($GetDateFormat)/(60*60*24));
$HYear=round($TDays/354.37419);
$Remain=$TDays-($HYear*354.37419);
$HMonths=round($Remain/29.531182);
$HDays=$Remain-($HMonths*29.531182);
$HYear=$HYear+1389;
$HMonths=$HMonths+10;
$HDays=$HDays+23;
if ($HDays>29.531188 and round($HDays)!=30)
{
$HMonths=$HMonths+1;
$HDays=Round($HDays-29.531182);
}
else
{
$HDays=Round($HDays);
}
if ($HMonths>12){$HMonths=$HMonths-12;$HYear=$HYear+1;}
$ResultDate="$HDays-$HMonths-$HYear";
$ResultDate="$ResultDate"."هـ";
return $ResultDate;
}// طريقة الاستدعاءecho Hijri($GetDateFormat);
function Hijri($GetDateFormat)
{
$TDays=round(strtotime($GetDateFormat)/(60*60*24));
$HYear=round($TDays/354.37419);
$Remain=$TDays-($HYear*354.37419);
$HMonths=round($Remain/29.531182);
$HDays=$Remain-($HMonths*29.531182);
$HYear=$HYear+1389;
$HMonths=$HMonths+10;
$HDays=$HDays+23;
if ($HDays>29.531188 and round($HDays)!=30)
{
$HMonths=$HMonths+1;
$HDays=Round($HDays-29.531182);
}
else
{
$HDays=Round($HDays);
}
if ($HMonths>12){$HMonths=$HMonths-12;$HYear=$HYear+1;}
$ResultDate="$HDays-$HMonths-$HYear";
$ResultDate="$ResultDate"."هـ";
return $ResultDate;
}// طريقة الاستدعاءecho Hijri($GetDateFormat);
ليست هناك تعليقات:
إرسال تعليق