Re: Suggestions?
| From: | Robert Cummings | Date: | Tue, 13 Jan 2009 19:21:38 +0000 |
| Subject: | Re: Suggestions? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-286256@lists.php.net to get a copy of this message | ||
On Tue, 2009-01-13 at 19:14 +0000, ceo@l-i-e.com wrote:
> Hard to say without knowing the data structures...
>
> You can't do a simple count of the holidays and add that, because you might end up with
> yet another holiday in the result.
>
> Start at 12/23 and want to add 6 business days.
>
> You find 1 holiday in between, so you add 7 business days and end up on New Year's Day, a
> non-business day.
>
> 12/23
> 12/24
> 12/25 X
> 12/26
> 12/27
> 12/28
> 12/29
> 12/30
> 12/31
> 01/01 X
>
> I think MySQL has built-in holiday / work day calculations, come to think of it...
I thought the calculation for holidays went as follows:
<?php
function isHoliday( $timestamp )
{
return checkingEmailsDuringDay( $timestamp ) ? false : true;
}
?>
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP