PHP cal_from_jd() Function
In this chapter you will learn:
- Definition for PHP cal_from_jd() Function
- Syntax for PHP cal_from_jd() Function
- Parameter for PHP cal_from_jd() Function
- Return value from PHP cal_from_jd() Function
- Example - converts a Julian day count into a date of a specified calendar
Definition
The cal_from_jd() function converts a Julian day count into a date of a specified calendar.
Syntax
PHP cal_from_jd() Function has the following syntax.
cal_from_jd(jd,calendar);
Parameter
Parameter | Is Required | Description |
---|---|---|
jd | Required. | Julian Day as an integer |
calendar | Required. | Calendar to convert to. |
Calendar must be one of the following values:
- CAL_GREGORIAN
- CAL_JULIAN
- CAL_JEWISH
- CAL_FRENCH
Return
PHP cal_from_jd() Function returns an array that contains calendar information.
Example
Converts a Julian day count into a date of a specified calendar
<?php
$d=unixtojd(mktime(0,0,0,6,20,2013));
print_r(cal_from_jd($d,CAL_GREGORIAN));
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP cal_info() Function
- Syntax for PHP cal_info() Function
- Parameter for PHP cal_info() Function
- Return value from PHP cal_info() Function
- Example - Get information about a calendar
Home » PHP Tutorial » PHP Calendar Functions