cal_to_jd() function in PHP



The cal_to_jd() function converts a date to Julian day count. It returns a Julian day number.

Syntax

cal_to_jd(calendar, month, day, year)

Parameters

  • calendar − The calendar to convert from. Possible values −

    • CAL_GREGORIAN

    • CAL_JULIAN

    • CAL_JEWISH

    • CAL_FRENCH

  • month  − Set the month as a number.

  • day  − Set the day as a number.

  • year  − Set the year as a number.

Return

The cal_to_jd() function returns a Julian day number.

Example

The following is an example −

 Live Demo

<?php
$res = cal_to_jd(CAL_GREGORIAN,10,15,2018);
echo $res;
?>

Output

2458407
Updated on: 2020-06-24T12:52:18+05:30

64 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements