In this article, you will learn how to convert a Gregorian Calendar date to Julian Date Count. Thanks to the name of the function which is showing the same meaning. Yes, the gregoriantojd() function converts a Gregorian date to Julian Day Count.
What is the syntax of the gregoriantojd() function in PHP?
gregoriantojd(month,day,year);
Parameters | Details |
---|---|
month | Specify the month number(1-12) – Required |
day | Specify the month number(1-31) – Required |
year | Specify the year number (-4714-9999)- Required |
Examples of the gregoriantojd function
Example 1. The following example converts a Gregorian date to a Julian Day Count and vice versa.
<?php
$j_d=gregoriantojd(16,21,2005);
echo $j_d;
echo jdtogregorian($j_d);
?>