Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: determining work hours between 2 dates

by kosie99 (Acolyte)
on Jun 12, 2006 at 20:12 UTC ( [id://554892]=note: print w/replies, xml ) Need Help??


in reply to determining work hours between 2 dates

There is one complication though: The 2 dates have a time component as well, so the first day can start any time and the end date too. So, I will need to calculate the HH:MM:SS for the first and last days as well. Kosie
  • Comment on Re: determining work hours between 2 dates

Replies are listed 'Best First'.
Re^2: determining work hours between 2 dates
by sgifford (Prior) on Jun 12, 2006 at 22:29 UTC
    That's easy enough, though: deal with the first and last days as special cases (with another special case if they are the same day), and use a standard tool for the ones inbetween.
Re^2: determining work hours between 2 dates
by tokpela (Chaplain) on Jun 13, 2006 at 02:45 UTC
    >> The 2 dates have a time component as well, so the first day
    >> can start any time and the end date too. So, I will need to
    >> calculate the HH:MM:SS for the first and last days as well.

    That's actually already taken into account in my test script above.
    It does the calculations in seconds and then converts to hours.

    The hard part for you may be dealing with holidays.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://554892]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2024-04-25 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found