Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

cal_from_jd

Description

Converts from Julian Day Count to a supported calendar

Syntax

cal_from_jd(int $julian_day, int $calendar): array

Parameters

julian_day

Julian day as integer

calendar

Calendar to convert to

NumberConstantDescription
0CAL_GREGORIANGregorian Calendar
1CAL_JULIANJulian Calendar
2CAL_JEWISHJewish Calendar
3CAL_FRENCHFrench Revolutionary Calendar

Return

Returns an array containing calendar information like month, day, year, day of week (dow), abbreviated and full names of weekday and month and the date in string form "month/day/year". The day of week ranges from 0 (Sunday) to 6 (Saturday).

Examples

1 · julian_day calendar | CAL_GREGORIAN

<?

$julian_day = unixtojd();
$calendar = CAL_GREGORIAN;

$return = cal_from_jd($julian_day, $calendar);

print_r($return);

?>
Array
(
    [date] => 2/24/2024
    [month] => 2
    [day] => 24
    [year] => 2024
    [dow] => 6
    [abbrevdayname] => Sat
    [dayname] => Saturday
    [abbrevmonth] => Feb
    [monthname] => February
)

2 · julian_day calendar | CAL_JULIAN

<?

$julian_day = unixtojd();
$calendar = CAL_JULIAN;

$return = cal_from_jd($julian_day, $calendar);

print_r($return);

?>
Array
(
    [date] => 2/11/2024
    [month] => 2
    [day] => 11
    [year] => 2024
    [dow] => 6
    [abbrevdayname] => Sat
    [dayname] => Saturday
    [abbrevmonth] => Feb
    [monthname] => February
)

3 · julian_day calendar | CAL_JEWISH

<?

$julian_day = unixtojd();
$calendar = CAL_JEWISH;

$return = cal_from_jd($julian_day, $calendar);

print_r($return);

?>
Array
(
    [date] => 6/15/5784
    [month] => 6
    [day] => 15
    [year] => 5784
    [dow] => 6
    [abbrevdayname] => Sat
    [dayname] => Saturday
    [abbrevmonth] => Adar I
    [monthname] => Adar I
)

4 · julian_day calendar | CAL_FRENCH

<?

$month = 9;
$day = 22;
$year = 1806;

$julian_day = gregoriantojd($month, $day, $year);
$calendar = CAL_FRENCH;

$return = cal_from_jd($julian_day, $calendar);

print_r($return);

?>
Array
(
    [date] => 13/5/14
    [month] => 13
    [day] => 5
    [year] => 14
    [dow] => 1
    [abbrevdayname] => Mon
    [dayname] => Monday
    [abbrevmonth] => Extra
    [monthname] => Extra
)
HomeMenu