PHP - Function easter_date()


Advertisements


Syntax

easter_date ( [$year] );

Definition and Usage

This function returns the Unix timestamp corresponding to midnight on Easter of the given year.

Parameters

Parameter Description
year Optional. The year as a number between 1970 an 2037

Return Value

Unix timestamp corresponding to midnight on Easter of the given year.

Example

Try out following example −

<?php
   echo date("M-d-Y", easter_date(2019));
   echo "<br />";
   
   echo date("M-d-Y", easter_date(2010));
   echo "<br />";
   
   echo date("M-d-Y", easter_date(2007)); 
?> 

This will produce the following result −

Apr-21-2019
Apr-04-2010
Apr-08-2007

php_function_reference.htm