The cal_from_jd() function is an inbuilt function in PHP which is used to convert a Julian Day Count into supported calendar such as Gregorian calendar, French Calendar, Jewish calendar etc. This function accepts two parameters $jd and $calendar and returns the array containing calendar information of the specified calendar.
array cal_from_jd( $jd, $calendar )
Parameters: This function accepts two parameters as mentioned above and described below:
- $jd: It is used to specify the Julian day as integer.
- $calendar: It is used to specify the calendar in which date converted. The supported calendars are Gregorian calendar, Julian calendar, French calendar and Jewish calendar.
Return Value: This function returns an array containing calendar information which are listed below:
- date in form “month/day/year”
- day of week
- abbreviated and full names of weekday and month
Array ( [date] => 8/16/2016 [month] => 8 [day] => 16 [year] => 2016 [dow] => 2 [abbrevdayname] => Tue [dayname] => Tuesday [abbrevmonth] => Aug [monthname] => August )
Array ( [date] => 11/4/5767 [month] => 11 [day] => 4 [year] => 5767 [dow] => 3 [abbrevdayname] => Wed [dayname] => Wednesday [abbrevmonth] => Tammuz [monthname] => Tammuz )
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.