Contact Doug!
Learn About Doug!
View Doug Boude's online resume
updated 11/18/2009

View Doug Boude's profile on LinkedIn
Link to me!

Follow Doug Boude on Twitter
Follow me!

Be Doug's friend on Facebook
Befriend me!
(I promise not to follow you home)
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...
Florida web site design



Czech your Page Rank!
Check Page Rank of any web site pages instantly:
This free page rank checking tool is powered by Page Rank Checker service
Surf's Up!
Visit Egosurf.org and massage YOUR web ego!
My Score: 9,001
Doug's Books

Read (and recommend)

  • Men are from Mars, Women are from Venus
  • The Wisdom of Crowds: Why the Many Are Smarter Than the Few and How Collective Wisdom Shapes Business, Economies, Societies and Nations
  • Blink: The Power of Thinking Without Thinking
  • Head First Design Patterns
  • Transact-SQL Programming
  • What's So Amazing About Grace?
  • Just So Stories (Rudyard Kipling collection)

Reading

  • Prayer: Does it Make Any Difference?
  • Data Mining (Practical Machine Learning Tools and Techniques)
<< May, 2008 >>
SMTWTFS
123
45678910
11121314151617
18192021222324
25262728293031
Search Blog

Recent Comments
Categories
Archives
Photo Albums
Funnies (5)
Family (3)
RSS

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!!!

16 plus 0 equals
Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!