Using PHP's easter_date Function to Get Easter Midnight Unix Timestamp

This article explains PHP's easter_date function, which returns the Unix timestamp for midnight on Easter Sunday of a specified year (1970‑2037), details its year parameter, return value, and provides sample code demonstrating its usage.

Laravel Tech Community
Laravel Tech Community
Laravel Tech Community
Using PHP's easter_date Function to Get Easter Midnight Unix Timestamp

The PHP function easter_date() returns the Unix timestamp for midnight on Easter Sunday of a given year, supporting years between 1970 and 2037.

Parameter

year – an integer representing the year (1970‑2037).

Return value

The Unix timestamp corresponding to Easter Sunday midnight for the specified year.

Example

<?php
echo date("M-d-Y", easter_date(1999)); // Apr-04-1999
echo date("M-d-Y", easter_date(2000)); // Apr-23-2000
echo date("M-d-Y", easter_date(2001)); // Apr-15-2001
?>
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PHPdate functioneaster_date
Laravel Tech Community
Written by

Laravel Tech Community

Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.