# Alternative Calendars PHP

PHP offers a powerful way to convert dates from one calendar system to another. In order to do this, you must first convert a date into a Julian Day Count. You then convert that integer back into a date according to another calendar. These functions require the calendar extension. You may load it dynamically, or compile it into PHP.

integer easter_date(integer year)

Use easter_date to get the timestamp for midnight on Easter for a given year.

<?
print(easter_date(2000));
?>

integer easter_days(integer year)
The easter_days function returns the number of days after March 21 on which Easter falls for the given year.

<?
print(easter_days(2000));
?>

integer frenchtojd(integer month, integer day, integer year)
The frenchtojd function returns the Julian Day Count for the given French Republican calendar date.

<?
$jdc = frenchtojd(1,1,1); print(jdtogregorian($jdc));
?>

integer gregoriantojd(integer month, integer day, integer year)
The gregoriantojd function returns the Julian Day Count for the given Gregorian date.

<?
$jdc = gregoriantojd(1,1,1); print(jdtogregorian($jdc));
?>

value jddayofweek(integer julian_day, integer mode)
The jddayofweek function returns either an integer or a string, depending on the mode. Modes are listed.

<?
$jdc = gregoriantojd(1,1,1); print(jddayofweek($jdc, 1)); ?>

string jdmonthname(integer julian_day, integer mode)
The jdmonthname function returns the name of the month for a particular day. The mode argument specifies which calendar to draw month names from.

<?
$jdc = gregoriantojd(1,1,1800); print(jdmonthname($jdc, 0) . "<BR> ");
print(jdmonthname($jdc, 1) . "<BR> "); print(jdmonthname($jdc, 2) . "<BR> ");
print(jdmonthname($jdc, 3) . "<BR> "); print(jdmonthname($jdc, 4) . "<BR> ");
print(jdmonthname($jdc, 5) . "<BR> "); ?> string jdtofrench(integer julian_day) The jdtofrench function returns the date on the French Republican calendar for a Julian Day Count. <?$jdc = gregoriantojd(1,1,1800);
print(jdtofrench($jdc)); ?> string jdtogregorian(integer julian_day) Use the jdtogregorian function to convert a Julian Day Count to a Gregorian date. <?$jdc = jewishtojd(1,1,1);
print(jdtogregorian($jdc)); ?> string jdtojewish(integer julian_day) The jdtojewish function returns the Jewish calendar date for the given Julian Day Count. <?$jdc = gregoriantojd(1,1,1);
print(jdtojewish($jdc)); ?> string jdtojulian(integer julian_day) Use the jdtojulian function to get the Julian date for a Julian Day Count. <?$jdc = gregoriantojd(1,1,1);
print(jdtojulian($jdc)); ?> integer jewishtojd(integer month, integer day, integer year) The jewishtojd function returns a Julian Day Count for the given Jewish calendar date. <?$jdc = jewishtojd(1,1,1);
print(jdtogregorian($jdc)); ?> integer juliantojd(integer month, integer day, integer year) Use the juliantojd function to get the Julian Day Count for a Julian calendar date. <?$jdc = juliantojd(1,1,1);
print(jdtogregorian(\$jdc));
?>