PHP | jdtojulian() Function
The jdtojulian() function is an inbuilt function in PHP which is used to convert a Julian day count to a Julian calendar Date. It converts Julian Day Count to a string containing the Julian Calendar Date in the month/day/year format.
Syntax:
int jdtojulian( $julianday )
Parameters: This function accepts single parameter $julianday which is mandatory. It contains julian day as integer.
Return Value: This function returns the Julian Date as a string in the month/day/year format.
Below programs illustrate the jdtojulian() function in PHP.
Program 1:
<?php // Converts a Julian calender date // to Julian Day count. $jdate = juliantojd(10, 25, 1996); // Print the Julian Day count. echo "JulianToJD is : ".$jdate . "\n"; // First converts the julian day to Julian // Calender date and then print it. echo "JDToJulian is : ".jdtojulian($jdate); ?> |
JulianToJD is : 2450395 JDToJulian is : 10/25/1996
Program 2:
<?php // Converts Julian calender Date // to Julian Day count. $jdate = juliantojd(1, 10, 1998); // Print the Julian Day count echo "Julian Day Count : ".$jdate . "\n"; // Converts Julian Day count to // the Julian calender Date $julian = jdtojulian($jdate); // Print the julian calender Date. echo "Julian Calender Date : ".$julian; ?> |
Julian Day Count : 2450837 Julian Calender Date : 1/10/1998
Related Articles:
Reference: http://php.net/manual/en/function.jdtojulian.php
Recommended Posts:
- How to get the function name from within that function using JavaScript ?
- p5.js | int() function
- PHP | Ds\Map put() Function
- CSS | hsl() Function
- CSS | rgb() Function
- PHP Ds\Map sum() Function
- p5.js | log() function
- p5.js | cos() function
- p5.js | arc() Function
- CSS | var() Function
- D3.js | d3.set.has() Function
- p5.js | sin() function
- PHP | next() Function
- PHP Ds\Map first() Function
- D3.js | d3.sum() function
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.



