Re: [PHP] Re: Saturdays and Sundays

2005-09-01 Thread Jason Davidson
Here is an another approach.. if you glance at a calendar, youll notice that the only times there are 5 sats in a month, is when the 1st of 30 day month falls on a fri or sat.. or in a 31 day month, a thur, fri, or say.. So, you could simply test the weekday the first of the month has, and the

[PHP] Re: Saturdays and Sundays

2005-09-01 Thread Brian P. O'Donnell
Sorry, I made a mistake. See below: ""Brian P. O'Donnell"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > ""Shaun"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hi, > > > > Is it possible to get the number of saturdays and sundays for a given > month > > / year

[PHP] Re: Saturdays and Sundays

2005-09-01 Thread Brian P. O'Donnell
""Shaun"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > Is it possible to get the number of saturdays and sundays for a given month > / year? > > Thanks for your help. Here's another way to do it. Each function will return either 4 or 5. If you need both Saturdays and Sund

[PHP] Re: Saturdays and Sundays

2005-09-01 Thread M. Sokolewicz
since only the total number of saturdays/sundays is what he wants to know, you can use some clever math. Basically, the amount of saturdays in a year is: floor(365 (+1 if it's a leap year) (-days from january first to first saturday) / 7); and sundays = saturdays (-1 if the modulo from the top

[PHP] Re: Saturdays and Sundays

2005-09-01 Thread Wong HoWang
the answer is simply yes! You can have a simple for looping to do so. hope this help! ""Shaun"" <[EMAIL PROTECTED]> wrote:[EMAIL PROTECTED] > Hi, > > Is it possible to get the number of saturdays and sundays for a given > month / year? > > Thanks for your help. -- PHP General Mailing List