this is just the way I would do it:

generate timestamps for 8.00 and 17.30 for the days you want as long as the
timestamps are between the two original timestamps. after that it's all
subtraction and dividing by 60. That's about as efficient as I can think of.

Rich Cavanaugh

-----Original Message-----
From: Wim Koorenneef [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 11:26 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Calculate # of minutes during working hours between two
dates


Hi all,

I want to calculate the number of minutes between two dates, but only
those minutes on monday through friday between 08.00 and 17.30.

I could evaluate every minute in the interval against all known minutes
during working hours, but that's a bit much :-) Any suggestions for a
better, more efficient algorithm? Tia.

--
Greetinx,

Wim Koorenneef <[EMAIL PROTECTED]> Boxtel, the Netherlands


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to