easter_date() returns a Unix timestamp for Easter Sunday for a supported year.
$timestamp = easter_date(2027);
echo date('Y-m-d', $timestamp);$time_stamp=easter_date(2025);
echo "Easter date is :".date('m-d-Y',$time_stamp);
The output is here Easter date is :04-20-2025If year is not given the easter date of current year is returned. $time_stamp=easter_date();
echo "Easter date is :".date('m-d-Y',$time_stamp);
Output is here
Easter date is :04-05-2026
We can get unix timestamp of Easter day corresponding to midnight on Easter of the given year by using easter_date() function.easter_date(?int $year = null, int $mode = CAL_EASTER_DEFAULT): int
The function returns a Unix timestamp for local midnight on Easter Sunday. On current PHP versions, out-of-range years raise ValueError. easter_date() relies on the system C library and its TZ environment setting. If you need PHP-timezone-aware date arithmetic, use easter_days() with DateTimeImmutable.Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.