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.

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
// PHP program to demonstrate the
// use of jdtofrench() function 
  
// converts date to julian integer 
$jd = frenchtojd(1, 7, 13);
  
// prints the julian day integer 
echo "The julian day integer is ", $jd, "\n";
  
// converts the Julian day to French date
$date = jdtofrench($jd);
  
// prints the date
echo "The french date initially taken was ", ($date), "\n"
  
?>

chevron_right


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.

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
// PHP program to demonstrate the
// use of jdtofrench() function  
// in case of out of range parameter is passed 
  
// converts date to julian integer 
$jd = frenchtojd(1, 7, 18);
  
// prints the julian day integer as 0 as year is out of range
echo "The julian day integer is ", $jd, "\n";
  
// converts the Julian day to French date
$date = jdtofrench($jd);
  
// prints the date as 0/0/0 as french year is out of range
echo "The french date initially taken was ", ($date), "\n"
  
?>

chevron_right


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



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.