It returns the day of the week
Example
<?php
echo jddayofweek (cal_to_jd(CAL_GREGORIAN, date(“m”),date(“d”), date(“Y”)) , 1 );
?>
Output
Friday
It converts a Gregorian date to Julian Day Count
Example
<?php
echo gregoriantojd (2 , 2 , 14 )
?>
Output
1726206
It converts a date from the French Republican Calendar to a Julian Day Count
Example
<?php
echo frenchtojd(4,4,12);
?>
Output
2379951
It returns the number of days between March 21 and Easter day of a given year.
Example
<?php
echo easter_days(1984);
?>
Output
32
It returns the unix timestamp of easter date for a given year
Example
<?php
echo date(“M-d-Y”, easter_date(1984));
?>
Output
Apr-22-1984
It converts from a supported calendar to Julian Day Count.
Example
<?php
echo cal_to_jd(CAL_GREGORIAN,05,17,1984);
?>
Output
2445838
It returns information about a particular calendar
Example
<?php
echo “<pre>”;
$calInfo = cal_info(CAL_GREGORIAN);
print_r($calInfo);
?>
Output
Array
(
[months] => Array
(
[1] => January
[2] => February
[3] => March
[4] => April
[5] => May
[6] => June
[7] => July
[8] => August
[9] => September
[10] => October
[11] => November
[12] => December
)
[abbrevmonths] => Array
(
[1] => Jan
[2] => Feb
[3] => Mar
[4] => Apr
[5] => May
[6] => Jun
[7] => Jul
[8] => Aug
[9] => Sep
[10] => Oct
[11] => Nov
[12] => Dec
)
[maxdaysinmonth] => 31
[calname] => Gregorian
[calsymbol] => CAL_GREGORIAN
)
0 or CAL_GREGORIAN – Gregorian Calendar
1 or CAL_JULIAN – Julian Calendar
2 or CAL_JEWISH – Jewish Calendar
3 or CAL_FRENCH – French Revolutionary Calendar
It converts from Julian Day Count to a supported calendar
Example
<?php
echo “<pre>”;
$day = unixtojd(mktime(0, 0, 0, 5, 17, 1984));
print_r(cal_from_jd($day, CAL_GREGORIAN));
?>
Output
Array
(
[date] => 5/17/1984
[month] => 5
[day] => 17
[year] => 1984
[dow] => 4
[abbrevdayname] => Thu
[dayname] => Thursday
[abbrevmonth] => May
[monthname] => May
)
It returns the number of days in a month for a given year and calendar
Example
<?php
$number = cal_days_in_month(CAL_GREGORIAN, 2, 1984);
echo $number.” days”;
?>
Output
29 days
cal_days_in_month – It returns the number of days in a month for a given year and calendar
cal_from_jd – It converts from Julian Day Count to a supported calendar
cal_info – It returns information about a particular calendar
cal_to_jd – It converts from a supported calendar to Julian Day Count.
easter_date – It returns the unix timestamp of easter date for a given year
easter_days – It returns the no of days between March 21 and Easter day of a given year.
FrenchToJD – It converts a date from the French Republican Calendar to a Julian Day Count
GregorianToJD – It converts a Gregorian date to Julian Day Count
JDDayOfWeek – It returns the day of the week
JDMonthName – It returns a month name
JDToFrench – It converts a Julian Day Count to the French Republican Calendar
JDToGregorian – It converts Julian Day Count to Gregorian date
jdtojewish – It converts a Julian day count to a Jewish calendar date
JDToJulian – It converts a Julian Day Count to a Julian Calendar Date
jdtounix – It convert Julian Day to Unix timestamp
JewishToJD – It converts a date in the Jewish Calendar to Julian Day Count
JulianToJD – It converts a Julian Calendar date to Julian Day Count
unixtojd – It convert Unix timestamp to Julian Day
Posts navigation
Zend | Magento Certified PHP | eCommerce Architect