Skip to content
Related Articles

Related Articles

Improve Article

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
  
// Converts a Julian calendar 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 
// Calendar date and then print it.
echo "JDToJulian is : ".jdtojulian($jdate);
  
?>
Output: 
JulianToJD is : 2450395
JDToJulian is : 10/25/1996

 

Program 2: 
 

php




<?php
  
// Converts Julian calendar 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 calendar Date
$julian = jdtojulian($jdate);
  
// Print the julian calendar Date.
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
 




My Personal Notes arrow_drop_up
Recommended Articles
Page :