PHP jdtofrench() Function
The PHP jdtofrench() function converts a Julian Day Count to the French Republican Calendar. The function takes a Julian Day integer and returns the converted French Republican date as a string in the form "month/day/year".
Syntax
jdtofrench(julian_day)
Parameters
julian_day |
Required. Specify a Julian day number as integer. |
Return Value
Returns the French revolution date as a string in the form "month/day/year".
Exceptions
NA.
Example:
The example below shows the usage of jdtofrench() function.
<?php //converting a French Republican date //to Julian integer $jd = frenchtojd(10, 2, 12); //displaying the Julian day integer echo "The Julian day integer is: $jd \n"; //converting the Julian day integer //to French Republican date $date = jdtofrench($jd); //displaying the French Republican date echo "The French Republican date is: $date \n"; ?>
The output of the above code will be:
The Julian day integer is: 2380129 The French Republican date is: 10/2/12
Example: Overflow behavior
Consider one more example to see the overflow behavior of this function.
<?php //converting an invalid French Republican //date to Julian integer $jd = frenchtojd(10, 2, 18); //prints 0 as year is out of range echo "The Julian day integer is: $jd \n"; //converting the Julian day integer //to French Republican date $date = jdtofrench($jd); //prints 0/0/0 as French Republican //year is out of range echo "The French Republican date is: $date \n"; ?>
The output of the above code will be:
The Julian day integer is: 0 The French Republican date is: 0/0/0
❮ PHP Calendar Reference