YouTip LogoYouTip

Func Cal Cal From Jd

```html PHP cal_from_jd() Function

PHP cal_from_jd() Function

This article is part of the , where you not only learn technology but also your dreams!

PHP cal_from_jd() Function

The cal_from_jd() function in PHP converts a Julian Day Number (JDN) to a calendar date.

Syntax

array cal_from_jd ( int $jd , int $calendar )

Parameters

jd
The Julian Day Number.
calendar
The type of calendar. This can be one of the following constants:
CAL_GREGORIAN - Gregorian calendar
CAL_JULIAN - Julian calendar
CAL_JEWISH - Jewish calendar
CAL_FRENCH - French Revolutionary calendar
CAL_HEBREW - Hebrew calendar
CAL_ISO8601 - ISO 8601 calendar
CAL_PERSIAN - Persian calendar
CAL_THAI - Thai Buddhist calendar
CAL_ROOMANIAN - Romanian calendar
CAL_HIJRI - Hijri calendar

Returns

An associative array containing the year, month, day, and other information about the given Julian Day Number in the specified calendar.

Example

<?php
$jd = gregoriantojd(2023, 10, 1);
print_r(cal_from_jd($jd, CAL_GREGORIAN));
?>

Output:

Array
(
     => 2023
     => 10
     => 1
     => 1
     => 1
     => October
     => 1
     => 2023
)

© 2023 . All rights reserved.

```
← Func Cal Cal InfoFunc Cal Cal Days In Month β†’