PHP | jdtojulian() Function
Last Updated :
20 Jul, 2021
The jdtojulian() function is an inbuilt function in PHP that 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 a single parameter $julianday which is mandatory. It contains Julian’s day as an integer.
Return Value: This function returns the Julian Date as a string in the month/day/year format.
The below programs illustrate the jdtojulian() function in PHP.
Program 1:
php
<?php
$jdate = juliantojd(10, 25, 1996);
echo "JulianToJD is : " . $jdate . "\n" ;
echo "JDToJulian is : " .jdtojulian( $jdate );
?>
|
Output:
JulianToJD is : 2450395
JDToJulian is : 10/25/1996
Program 2:
php
<?php
$jdate = juliantojd(1, 10, 1998);
echo "Julian Day Count : " . $jdate . "\n" ;
$julian = jdtojulian( $jdate );
echo "Julian Calendar Date : " . $julian ;
?>
|
Output:
Julian Day Count : 2450837
Julian Calendar Date : 1/10/1998
Related Articles:
Reference: http://php.net/manual/en/function.jdtojulian.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...