Antano Solar John > DateTime-BusinessHours-1.01a > DateTime::BusinessHours

Download:
DateTime-BusinessHours-1.01a.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 1.01   Source   Latest Release: DateTime-BusinessHours-2.03

NAME ^

BusinessHours - An object that calculates business days and hours

SYNOPSIS ^

  use BusinessHours;
  use DateTime;

  my $datetime1=DateTime->new(year=>2007,month=>10,day=>15);
  my $datetime2 = DateTime->now;

  my $testing = BusinessHours->new(datetime1=>$datetime1,
                                  datetime2=>$datetime2,
                                  worktiming=>[9,18], # 9 am to 6 om
                                  weekends=>[6,7], #saturday , sunday
                                  holidays=>["2007-10-31",2007-12-24]
                                  holidayfile=>'holidaylist' #holidaylist is a text file 
                                                             #with each date in a new line
                                                             #in the format yyyy-mm-dd  
                                 );

  print $testing->getdays."\n"; # the total business days 

  print $testing->gethours; # the total business hours

DESCRIPTION ^

BusinessHours a class for caculating the business hours between two DateTime objects.It can be useful in situations like escalation where an action has to happen after a certain number of business hours.

USAGE ^

Create an instance of the class with the two required datetime objects. and use the methods to get the business hours or days.

Constructors

Methods

This class has two methods.

AUTHOR ^

Antano Solar John<solar345@gmail.com>

COPYRIGHT ^

Copyright (c) 2007 Antano Solar John. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

syntax highlighting: