PHP | jdtofrench() Function
The jdtofrench() function is a built-in function which converts a Julian Day Integer to French date. The function accepts a Julian Day integer and returns the converted French Date in $month / $day / $year.
Syntax:
jdtofrench($jd)
Parameters: The function accepts one mandatory parameter $jd which specifies the Julian day.
Return Value: The function returns the French date. The return format of the date is $month / $day / $year. If the Julian day integer is passed as 0, then 0/0/0 is returned as output.
Examples:
Input : 2379254
Output : 5/8/10
Input : 2380229
Output : 1/7/13
Below programs illustrate the jdtofrench() function.
Program 1: The program below illustrate the use of jdtofrench() function.
<?php
$jd = frenchtojd(1, 7, 13);
echo "The julian day integer is " , $jd , "\n" ;
$date = jdtofrench( $jd );
echo "The french date initially taken was " , ( $date ), "\n" ;
?>
|
Output:
The julian day integer is 2380229
The french date initially taken was 1/7/13
Program 2: The program below shows the output when an invalid Julian day integer is passed.
<?php
$jd = frenchtojd(1, 7, 18);
echo "The julian day integer is " , $jd , "\n" ;
$date = jdtofrench( $jd );
echo "The french date initially taken was " , ( $date ), "\n" ;
?>
|
Output:
The julian day integer is 0
The french date initially taken was 0/0/0
Reference:
http://php.net/manual/en/function.jdtofrench.php
Last Updated :
30 Apr, 2018
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...