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_to_jd()

Example

Convert June 20, 2007 (Gregorian calendar) to a Julian Day Count.

<?php
$d=cal_to_jd(CAL_GREGORIAN,6,20,2007);
echo $d;
?>

Definition and Usage

The cal_to_jd() function converts a date from a specified calendar to a Julian Day Count.

Syntax

cal_to_jd(calendar,month,day,year);

Parameter Values

Parameter

Description

calendar

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

  • CAL_GREGORIAN
  • CAL_JULIAN
  • CAL_JEWISH
  • CAL_FRENCH

month

Required. Specifies the month as a numeric value.

day

Required. Specifies the day as a numeric value.

year

Required. Specifies the year as a numeric value.

Technical Details

Return Value:

Returns a Julian Day number

PHP Version:

4.1+