Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

cal_from_jd()

Example

Convert a Julian Day Count into a date in the Gregorian calendar.

<?php
$d=unixtojd(mktime(0,0,0,6,20,2007));
print_r(cal_from_jd($d,CAL_GREGORIAN));
?>

Definition and Usage

The cal_from_jd() function converts a Julian Day Count into a date in a specified calendar system.

Syntax

cal_from_jd(jd,calendar);

Parameter Values

Parameter

Description

jd

Required. Specifies the Julian Day as an integer.

calendar

Required. Specifies the calendar to convert to. Must be one of the following values:

  • CAL_GREGORIAN
  • CAL_JULIAN
  • CAL_JEWISH
  • CAL_FRENCH

Technical Details

 

Return Value:

Returns an array with calendar information including:

  • Date in the format “month/day/year”
  • Month
  • Year
  • Day of the week
  • Abbreviated and full names of the weekday and month

PHP Version:

4.1+