public function convertGregorianToJd($year, $month, $day)
{
// Special case mapping 0/0/0 -> 0
if ($year == 0 || $month == 0 || $day == 0) {
return 0;
}
$m1412 = $month <= 2 ? -1 : 0;
return floor(1461 * ($year + 4800 + $m1412) / 4) + floor(367 * ($month - 2 - 12 * $m1412) / 12) - floor(3 * floor(($year + 4900 + $m1412) / 100) / 4) + $day - 32075;
}