<?Php
echo frenchtojd(12,22,12); // Output is 2380209
echo "<br>";
echo frenchtojd(13,22,2); // Output is 2376586
echo "<br>";
echo frenchtojd(14,22,3); // Output is 0
echo "<br>";
echo frenchtojd(13,22,3); // Output is 2376951
?>
Syntax
int frenchtojd ( int $month , int $day , int $year )
Parameter | DESCRIPTION |
---|---|
$year | Required : Year between 1 to 14 |
$day | Required : between 1 to 30 |
$month | Required : Number from 1 to 13 |
This example demonstrates how to convert a French Republican calendar date into a Julian Day Number using FrenchToJD().
$jd = FrenchToJD(2, 7, 3); // Converts 7th day of 2nd month in year 3
echo "Julian Day Number: " . $jd;
Output:
Julian Day Number: 2376606
---
This example converts a French Republican date to a Julian Day Number and then back to the Gregorian calendar.
$jd = FrenchToJD(2, 7, 3); // 7th day of 2nd month in year 3
$gregorianDate = cal_from_jd($jd, CAL_GREGORIAN);
print_r($gregorianDate);
Output:
Array ( [date] => 10/28/1794 [month] => 10 [day] => 28 [year] => 1794 [dow] => 2
[abbrevdayname] => Tue [dayname] => Tuesday [abbrevmonth] => Oct [monthname] => October )