<HTML ><HEAD ><TITLE >Calendar functions</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="Function Reference" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="bzwrite" HREF="function.bzwrite.html"><LINK REL="NEXT" TITLE="cal_days_in_month" HREF="function.cal-days-in-month.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="reference" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.bzwrite.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.cal-days-in-month.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.calendar" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >VI. Calendar functions</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN10075" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="calendar.intro" ></A >Introduction</H1 ><P > The calendar extension presents a series of functions to simplify converting between different calendar formats. The intermediary or standard it is based on is the Julian Day Count. The Julian Day Count is a count of days starting from January 1st, 4713 B.C. To convert between calendar systems, you must first convert to Julian Day Count, then to the calendar system of your choice. Julian Day Count is very different from the Julian Calendar! For more information on Julian Day Count, visit <A HREF="http://serendipity.magnet.ch/hermetic/cal_stud/jdn.htm" TARGET="_top" >http://serendipity.magnet.ch/hermetic/cal_stud/jdn.htm</A >. For more information on calendar systems visit <A HREF="http://genealogy.org/~scottlee/cal-overview.html" TARGET="_top" >http://genealogy.org/~scottlee/cal-overview.html</A >. Excerpts from this page are included in these instructions, and are in quotes. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="calendar.installation" ></A >Installation</H1 ><P > To get these functions to work, you have to compile PHP with <TT CLASS="option" >--enable-calendar</TT >. </P ><P > The windows version of <TT CLASS="literal" >PHP</TT > has built in support for this extension. You do not need to load any additional extension in order to use these functions.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="calendar.configuration" ></A >Runtime Configuration</H1 ><P >This extension has no configuration directives defined in <TT CLASS="filename" >php.ini</TT >.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="calendar.resources" ></A >Resource Types</H1 ><P >This extension has no resource types defined.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="calendar.constants" ></A >Predefined Constants</H1 ><P > The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. </P ><P ></P ><DIV CLASS="variablelist" ><DL ><DT ><TT CLASS="constant" ><B >CAL_GREGORIAN</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_JULIAN</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_JEWISH</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_FRENCH</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_NUM_CALS</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_DOW_DAYNO</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_DOW_SHORT</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_DOW_LONG</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_MONTH_GREGORIAN_SHORT</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_MONTH_GREGORIAN_LONG</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_MONTH_JULIAN_SHORT</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_MONTH_JULIAN_LONG</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_MONTH_JEWISH</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_MONTH_FRENCH</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ></DL ></DIV ><P > The following constants are available since <TT CLASS="literal" >PHP</TT > 4.3.0 : </P ><P ></P ><DIV CLASS="variablelist" ><DL ><DT ><TT CLASS="constant" ><B >CAL_EASTER_DEFAULT</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_EASTER_ROMAN</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_EASTER_ALWAYS_GREGORIAN</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CAL_EASTER_ALWAYS_JULIAN</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ></DL ></DIV ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >Table of Contents</B ></DT ><DT ><A HREF="function.cal-days-in-month.html" >cal_days_in_month</A > -- Return the number of days in a month for a given year and calendar</DT ><DT ><A HREF="function.cal-from-jd.html" >cal_from_jd</A > -- Converts from Julian Day Count to a supported calendar and return extended information</DT ><DT ><A HREF="function.cal-info.html" >cal_info</A > -- Returns information about a particular calendar</DT ><DT ><A HREF="function.cal-to-jd.html" >cal_to_jd</A > -- Converts from a supported calendar to Julian Day Count</DT ><DT ><A HREF="function.easter-date.html" >easter_date</A > -- Get UNIX timestamp for midnight on Easter of a given year </DT ><DT ><A HREF="function.easter-days.html" >easter_days</A > -- Get number of days after March 21 on which Easter falls for a given year </DT ><DT ><A HREF="function.frenchtojd.html" >FrenchToJD</A > -- Converts a date from the French Republican Calendar to a Julian Day Count </DT ><DT ><A HREF="function.gregoriantojd.html" >GregorianToJD</A > -- Converts a Gregorian date to Julian Day Count </DT ><DT ><A HREF="function.jddayofweek.html" >JDDayOfWeek</A > -- Returns the day of the week</DT ><DT ><A HREF="function.jdmonthname.html" >JDMonthName</A > -- Returns a month name</DT ><DT ><A HREF="function.jdtofrench.html" >JDToFrench</A > -- Converts a Julian Day Count to the French Republican Calendar </DT ><DT ><A HREF="function.jdtogregorian.html" >JDToGregorian</A > -- Converts Julian Day Count to Gregorian date</DT ><DT ><A HREF="function.jdtojewish.html" >JDToJewish</A > -- Converts a Julian Day Count to the Jewish Calendar </DT ><DT ><A HREF="function.jdtojulian.html" >JDToJulian</A > -- Converts a Julian Day Count to a Julian Calendar Date </DT ><DT ><A HREF="function.jdtounix.html" >jdtounix</A > -- Convert Julian Day to UNIX timestamp</DT ><DT ><A HREF="function.jewishtojd.html" >JewishToJD</A > -- Converts a date in the Jewish Calendar to Julian Day Count </DT ><DT ><A HREF="function.juliantojd.html" >JulianToJD</A > -- Converts a Julian Calendar date to Julian Day Count </DT ><DT ><A HREF="function.unixtojd.html" >unixtojd</A > -- Convert UNIX timestamp to Julian Day</DT ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.bzwrite.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.cal-days-in-month.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >bzwrite</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >cal_days_in_month</TD ></TR ></TABLE ></DIV ></BODY ></HTML >