Calculate christ. Holidays from Easter date

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
leber33
Forum Newbie
Posts: 2
Joined: Fri Sep 13, 2002 3:14 am
Contact:

Calculate christ. Holidays from Easter date

Post by leber33 »

Hi everyone!!!!
I have to create an table for my company which prints the christian Holidays!!!
CXalculating the easter date of the was not the problem!!! But how do i for example get the date of the Palmsunday which is (Easter day - 7 days) I have prblems with the time format.
How can I substract 7days or 48 days from a date like March 31 2002!!!!!
Do I have to convert the day in juliantime and if so how can I do It
thanx
leber33
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Try something like this:

Code: Select all

$easter = easter_date(2002); // change 2002 to the required year
$sevendays = 7 * 24 *60 * 60;

echo 'Easter: '.date('d-M-Y', $easter);
echo '<br />';
echo 'Palm Sunday: '.date('d-M-Y', ($easter-$sevendays));
Mac
leber33
Forum Newbie
Posts: 2
Joined: Fri Sep 13, 2002 3:14 am
Contact:

thx

Post by leber33 »

Thanks I 'll give it a try!!!
Post Reply