Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Calculate down time of devices in prime time (only working hours, excluding p_holidays)

by phydeauxarff (Priest)
on Oct 13, 2003 at 12:27 UTC ( #298820=note: print w/ replies, xml ) Need Help??


in reply to Calculate down time of devices in prime time (only working hours, excluding p_holidays)

I just recently needed a similar report of business days that have passed for reporting and finally found date::calendar

The following is an example of taking two days and figuring out the delta of business days.

#!/usr/bin/perl use strict; use Date::Calendar; my $date_1 = [2003,9,24]; my $date_2 = [2003,10,9]; my $flag_1 = '1'; my $flag_2 = '0'; my $calendar = Date::Calendar->new({}); my $days = $calendar->delta_workdays($date_1,$date_2,$flag_1,$flag_2); print "$days\n";

There is also the ability to build your holiday list as well.

There is also Date::Business but I haven't given that a shot yet.


Comment on Re: Calculate down time of devices in prime time (only working hours, excluding p_holidays)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2014-08-31 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls