Hostgre


HomeReferencePHPPHP 5 Calendar Functions

PHP 5 Calendar Functions

Introduction

This extension contains functions that simplifies changing between totally different calendar formats. It is based on the julian Day Count, that is a count of days ranging from January first, 4713 B.C. Note: To convert between calendar formats, you need to first convert to standard Day Count, then to the calendar of your choice.

Installation

For these functions to work, you need to compile PHP with --enable-calendar. The Windows version of PHP has integral support for this extension.

PHP 5 Calendar Functions

FunctionDescription
cal_days_in_month()Returns the number of days in a month for a specified year and calendar
cal_from_jd()Converts a Julian Day Calendar Count into a date of a specified calendar
cal_info()Returns information about a specified calendar
cal_to_jd()Converts a date in a specified calendar to Julian Calendar Day Count
easter_date()Returns the Unix timestamp for midnight on Easter of a specified year
easter_days()Returns the number of days after March 21, that the Easter Day is in a specified year
frenchtojd()Converts a French Republican Calendar date to a Julian Calendar Day Count
gregoriantojd()Converts a Gregorian Calendar date to a Julian Calendar Day Count
jddayofweek()Returns the day of the week
jdmonthname()Returns a month name
jdtofrench()Converts a Julian Calendar Day Count to a French Republican Calendar date
jdtogregorian()Converts a Julian Calendar Day Count to a Gregorian Calendar date
jdtojewish()Converts a Julian Calendar Day Count to a Jewish Calendar date
jdtojulian()Converts a Julian Calendar Day Count to a Julian Calendar date
jdtounix()Converts Julian Calendar Day Count to Unix timestamp
jewishtojd()Converts a Jewish Calendar date to a Julian Day Count
juliantojd()Converts a Julian Calendar date to a Julian Day Count
unixtojd()Converts Unix timestamp to Julian Calendar Day Count

PHP 5 Calendar Constants

ConstantTypePHP Version
CAL_GREGORIANIntegerPHP 4
CAL_JULIANIntegerPHP 4
CAL_JEWISHIntegerPHP 4
CAL_FRENCHIntegerPHP 4
CAL_NUM_CALSIntegerPHP 4
CAL_DOW_DAYNOIntegerPHP 4
CAL_DOW_SHORTIntegerPHP 4
CAL_DOW_LONGIntegerPHP 4
CAL_MONTH_GREGORIAN_SHORTIntegerPHP 4
CAL_MONTH_GREGORIAN_LONGIntegerPHP 4
CAL_MONTH_JULIAN_SHORTIntegerPHP 4
CAL_MONTH_JULIAN_LONGIntegerPHP 4
CAL_MONTH_JEWISHIntegerPHP 4
CAL_MONTH_FRENCHIntegerPHP 4
CAL_EASTER_DEFAULTIntegerPHP 4.3
CAL_EASTER_ROMANIntegerPHP 4.3
CAL_EASTER_ALWAYS_GREGORIANIntegerPHP 4.3
CAL_EASTER_ALWAYS_JULIANIntegerPHP 4.3
CAL_JEWISH_ADD_ALAFIM_GERESHIntegerPHP 5.0
CAL_JEWISH_ADD_ALAFIMIntegerPHP 5.0
CAL_JEWISH_ADD_GERESHAYIMIntegerPHP 5.0