easter_date() returns a Unix timestamp for Easter Sunday for a supported year.
date_default_timezone_set('UTC');
$timestamp = easter_date(2027);
echo date('Y-m-d', $timestamp);Current example first; the detailed examples and demos below are retained for additional learning and comparison.
\=easter_date(2025);
echo "Easter date is :".date('m-d-Y',\);
The output is here Easter date is :04-20-2025If year is not given the easter date of current year is returned. \1745132400=easter_date();
echo "Easter date is :".date('m-d-Y',\1745132400)
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(YYYY);
Here we are entering year in YYYY format , like 1998. The output is unix time stamp of midnight of easter day of the year.
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.