PHP

PHP Menu

PHP

cal_to_jd() Function - Definition, Syntax, Parameters, Examples

Definition

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

Syntax

cal_to_jd(calendar, month, day, year)

Parameters

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 number.
day Required. Specifies the day as a number.
year Required. Specifies the year as a number.

Example

<?php

$jd = cal_to_jd(CAL_GREGORIAN, 7, 1, 2021);
echo $jd;

Introduction

PHP Basics

PHP Advance

PHP OOP

PHP Functions and Methods