PHP cal from jd

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PHP : cal_from_jd() function

Description

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 :

  1. $fut_date = unixtojd(mktime(0,0,0,1,18,2006));  

  2. print_r(cal_from_jd($fut_date, CAL_GREGORIAN));  

  3. ?>  

Output :

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