w3resource

PHP: cal_from_jd() function

Converts from Julian Day Count to a supported calendar

The cal_from_jd() function converts a given Julian day into a date (in the form of an array) of a supported calendar.

Version:

(PHP 4 and above)

Syntax:

cal_from_jd(jd, calendar )

Parameters:

Name Description Required /
Optional
Type
jd Julian day. Required Integer
calendar Supported calendar values are CAL_GREGORIAN,
CAL_JULIAN,
CAL_JEWISH and
CAL_FRENCH.
Required Integer

Return value:

An array containing calendar information.

Value Type: Date

Example:

<?php
$fut_date = unixtojd(mktime(0,0,0,1,18,2006));
print_r(cal_from_jd($fut_date, CAL_GREGORIAN));
?>

Sample Output:

Array ( [date] => 1/18/2006 [month] => 1 [day] => 18 [year] => 2006 [dow] => 3 [abbrevdayname] => Wed[dayname] => Wednesday [abbrevmonth] => Jan [monthname] => January ) 

View the example in the browser

See also

PHP Function Reference

Previous: cal_days_in_month
Next: cal_info



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/php/function-reference/cal_from_jd.php