Doug's Resume
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...

heaters
hotels boeken in 7 sec
Engagement Rings
Online Dating Australia




SURF'S UP!
You:
Your Web Site:
<< May, 2008 >>
SMTWTFS
123
45678910
11121314151617
18192021222324
25262728293031
Search Blog

ColdFusion Jobs
Recent Comments
Re: Viewing Option Text (in IE7) that's Wider than the Select List (by Dan Roberts at 5/15 2:38 PM)
Re: Viewing Option Text (in IE7) that's Wider than the Select List (by Dan Roberts at 5/15 10:06 AM)
Re: Inline CSS and Ajax Issue with IE (by Ben Nadel at 5/14 11:50 AM)
Re: The Perfect Alternative to Gas Powered Vehicles (by Thomas Messier at 5/09 12:47 PM)
Re: Promoting Family Unity: Lowering Your Utility Bills! (by Fernando Lopez at 5/07 10:12 PM)
Re: Why I Hate ORMs (a solicited rant) (by Richard at 5/06 10:56 AM)
Re: Why I Hate ORMs (a solicited rant) (by dougboude at 5/06 10:27 AM)
Re: Why I Hate ORMs (a solicited rant) (by Richard at 5/06 6:50 AM)
Re: Why I Hate ORMs (a solicited rant) (by Sean Corfield at 5/06 1:40 AM)
Re: Why I Hate ORMs (a solicited rant) (by Steve Bryant at 5/05 5:07 PM)
Categories
Archives
Photo Albums
Funnies (5)
Family (3)
RSS
Reciprocal Links

Powered by
BlogCFM v1.11

16 June 2006
Calculating Business Hours
ColdFusion function
I've had several requests for a copy of a function i wrote that calculates business time between two datetimes, so figured I'd go ahead and make it available via my blog.

It's kind of a long function, but I built it to be thorough and do a lot of validation and such. Also, there are  several supporting function included as well that it uses (not all of which are mine...credit given where applicable).

I couldn't find any documentation ( I thought I had written some, but it was probably just an email I sent to my coworkers), but it's fairly straightforward. Here's a sample call:

<cfset thesebizmins=bizMins(begin_dt,end_dt,8,17,12,"n")>

the function is heavily commented, including a header that explains the parameters and such. Let me know if you have any questions on it and I'll try to answer them.

You may need to edit the function getCompanyHolidays(). It has all the normal ones already, but there may be some you want to add or omit.

If you get any errors because a function is missing, let me know; I may have missed one of the supporting functions.

Oh, and feel absolutely free to share this with anybody you like. I am a true believer in the spirit of the internet, that nobody else should have to go through the same pains I have if me sharing what I learned
can prevent it.

Pay it forward.... :0)

Doug  :0)

P.S.
Oops! I had forgotten to include the supporting function 'validHour' (thanks Cathy Martin!), so added that just now (2/27/07).

************** Download the Code Here ********************



Posted by dougboude at 12:00 AM | PRINT THIS POST! |Link | 1 comment
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

Re: Calculating Business Hours
Thanks for the code. It'd worked great and very detailed too.
Posted by Jim Pickering on June 16, 2006 at 5:28 PM

Name:   Required
Email:   Required your email address will not be publicly displayed.

Want to receive notifications when new comments are added? Login/Register for an account.

Time to take the Turing Test!!!

What letter comes three place(s) after the letter O?
Type your answer exactly three time(s) in the designated box.

Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!