1. Home
  2. Computing & Technology
  3. PHP / MySQL

Easter_date () PHP Function

By , About.com Guide

Definition: Because Easter always falls on a Sunday, its numeric date changes every year. If we need to dynamically mark this on the calendar, we can use the easter_date () function. This function returns the timestamp for easter of a given year, or if no year is specified, the date of easter in the current year is returned. It is written as: easter_date (optional_year) ;
Also Known As: Easter Date, Easter Sunday
Examples:
<?php
echo easter_date(2005) ;
// Returns 1111899600

echo date("M-d-Y", easter_date(2006)) ;
//Returns Apr-16-2006

echo date("M-d-Y", easter_date()) ;
// Returns date of Easter for current year
?>
Explore PHP / MySQL
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. PHP Functions
  5. PHP Easter Date - Easter Date Year - PHP Easter Calendar

©2009 About.com, a part of The New York Times Company.

All rights reserved.