Friday, October 10, 2025
HomeLanguagesPHP | jdtojulian() Function

PHP | jdtojulian() Function

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
 

RELATED ARTICLES

Most Popular

Dominic
32350 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6718 POSTS0 COMMENTS
Nicole Veronica
11880 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11941 POSTS0 COMMENTS
Shaida Kate Naidoo
6838 POSTS0 COMMENTS
Ted Musemwa
7101 POSTS0 COMMENTS
Thapelo Manthata
6794 POSTS0 COMMENTS
Umr Jansen
6794 POSTS0 COMMENTS