Computer >> Computer tutorials >  >> Programming >> PHP

easter_date() function in PHP


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

Syntax

easter_date(year)

Parameters

  • year − Mention an year between 1970 and 2037. The default is the current year.

Return

The easter_date() function returns the easter date as a unix timestamp.

Example

The following is an example −

<?php
   echo easter_date() . "<br />";
   echo date("M-d-Y",easter_date()) . "<br />";
   echo date("M-d-Y",easter_date(2017)) . "<br />";
?>

Output

The following is the output −

1522555200
Apr-01-2018
Apr-16-2017