Calculate public holidays

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
User avatar
richie256
Forum Commoner
Posts: 37
Joined: Mon Oct 13, 2003 8:00 pm
Location: Montréal/Canada

Calculate public holidays

Post by richie256 »

I am making a function to calculate all the public holidays here in Canada with a gived Year. One on these public holidays is the Labour Day. It is the First Monday of the month of September. I just don't know to calculate it!

Someone can help me with that?
matthiasone
Forum Contributor
Posts: 117
Joined: Mon Jul 22, 2002 12:14 pm
Location: Texas, USA
Contact:

Post by matthiasone »

here is one way

Code: Select all

$year = '2003';
  $sdate = strtotime("9/1/$year");
  echo date('F j, Y', strtotime('next monday',$sdate));
User avatar
richie256
Forum Commoner
Posts: 37
Joined: Mon Oct 13, 2003 8:00 pm
Location: Montréal/Canada

Post by richie256 »

thank you matthiasone

Does anybody have another way? to get this with math function?
Post Reply