Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 studying the Monastery: (4)
As of 2015-07-05 07:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls