PHP easter_date() Function

Definition and Usage

The easter_date() function returns the Unix timestamp for midnight on Easter of a specified year.

Syntax

easter_date(year)

Parameter Description
year Optional. Defines the year to calculate the midnight on Easter from. If the year parameter is omitted, the current year is used.


Tips and Notes

Note: If the year is outside of the range for Unix timestamps (before 1970 or after 2037), this function will generate a warning. The easter_days() function can be used instead of easter_date() to calculate Easter for years which fall outside the range.

Example

<?php
echo(easter_date() . "<br />");
echo(date("M-d-Y",easter_date()) . "<br />");
echo(date("M-d-Y",easter_date(2000)) . "<br />");
echo(date("M-d-Y",easter_date(2001)) . "<br />");
echo(date("M-d-Y",easter_date(2002)));
?> 
 
OUTPUT :
1145138400
Apr-16-2006
Apr-23-2000
Apr-15-2001
Mar-31-2002