PHP | cal_to_jd() Function Last Updated : 11 Jul, 2025 Comments Improve Suggest changes 2 Likes Like Report The cal_to_jd() function is an inbuilt function in PHP which is used to converts a specified date into Julian Day Count. The cal_to_jd() function calculates the Julian day count for a date in the specified calendar. This function supports CAL_GREGORIAN, CAL_JULIAN, CAL_JEWISH and CAL_FRENCH calendars.Syntax: int cal_to_jd( $calendar, $month, $day, $year ) Parameters: This function accepts four parameters as mentioned above and described below: $calendar: It is used to specify the calendar for calculation. The calendar values are Gregorian calendar, French calendar, Jewish calendar and Julian calendar.$month: It is used to specify the Month in the selected calendar.$day: It is used to specify the Day in the selected calendar.$year : It is used to specify the year in the selected calendar. Return Value: This function returns a Julian Day number.Below programs illustrate the cal_to_jd() function in PHP.Program 1: php <?php // Converts a Gregorian calendar Date // into Julian Day number. $date = cal_to_jd(CAL_GREGORIAN, 11, 03, 2007); // Prints the conversion of date to // Julian Day number. echo $date; ?> Output: 2454408 Program 2: php <?php // Converts Julian calendar Date into // Julian Day count. $date = cal_to_jd(CAL_JULIAN, 7, 20, 20017); // Prints the above conversion. echo $date; ?> Output: 9032468 Related Articles: PHP | cal_days_in_month() FunctionPHP | easter_days() Function Reference: https://www.php.net/manual/en/function.cal-to-jd.php Comment U ukasp Follow 2 Improve U ukasp Follow 2 Improve Article Tags : Web Technologies PHP PHP-Calendar PHP-function Explore PHP Tutorial 8 min read BasicsPHP Syntax 4 min read PHP Variables 5 min read PHP | Functions 8 min read PHP Loops 4 min read ArrayPHP Arrays 5 min read PHP Associative Arrays 4 min read Multidimensional arrays in PHP 5 min read Sorting Arrays in PHP 4 min read OOPs & InterfacesPHP Classes 2 min read PHP | Constructors and Destructors 5 min read PHP Access Modifiers 4 min read Multiple Inheritance in PHP 4 min read MySQL DatabasePHP | MySQL Database Introduction 4 min read PHP Database connection 2 min read PHP | MySQL ( Creating Database ) 3 min read PHP | MySQL ( Creating Table ) 3 min read PHP AdvancePHP Superglobals 6 min read PHP | Regular Expressions 12 min read PHP Form Handling 4 min read PHP File Handling 4 min read PHP | Uploading File 3 min read PHP Cookies 9 min read PHP | Sessions 7 min read Like