Re: [PHP] Last working day of a month
- From: aballard@xxxxxxxxx ("Andrew Ballard")
- Date: Thu, 4 Dec 2008 09:32:27 -0500
On Thu, Dec 4, 2008 at 9:03 AM, Angelo Zanetti <angelo@xxxxxxxxxxxxxxx> wrote:
Hi all,
I am busy trying to figure out how to get the last working day in a month.
I was wondering if there was a script already written, but this is what I
imagine should work:
Get the current day and see if it's the last day of the month. If its true
check if it's a Saturday or Sunday if it's either of those 2 days then
return false else return true?
I also need to take public holidays into account. What would be the best
solution for that? Store the public holidays in a table and check if the
current day isn't a public holiday?
Any advice is appreciated.
TIA
Angelo
If your application is already using a database, I would use a date
table rather than a holiday table. You can add columns to indicate
whether each date is a workday, weekday, weekend, holiday, or any
other date category/group that you need to track.
Andrew
.
- Follow-Ups:
- RE: [PHP] Last working day of a month
- From: "Boyd, Todd M."
- RE: [PHP] Last working day of a month
- References:
- Last working day of a month
- From: "Angelo Zanetti"
- Last working day of a month
- Prev by Date: Re: [PHP] IE8 and HTML5
- Next by Date: How to fetch .DOC or .DOCX file in php
- Previous by thread: Last working day of a month
- Next by thread: RE: [PHP] Last working day of a month
- Index(es):
Relevant Pages
|