CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
calculating days difference between two dates

 



tabing16
New User

Jan 15, 2009, 2:50 AM

Post #1 of 2 (599 views)
calculating days difference between two dates Can't Post

Hi, I am new to Perl. I am looking for a way to calculate difference between two dates excluding weekend and holidays (if there is any). I know that I can use Date::Calc module to calculate days difference:

use strict;
use warnings;
use Date::Calc qw(:all);

my @first = (2008, 1, 14);
my @second = (2008, 1, 19);
my $dd = Delta_Days( @first, @second );

print $dd;

But how do I tell my program to exlcude any weekends and holidays that exist between two dates?

thanks


KevinR
Veteran


Jan 15, 2009, 8:58 AM

Post #2 of 2 (590 views)
Re: [tabing16] calculating days difference between two dates [In reply to] Can't Post

Look at the Date::Calc modules documentation and see if it mentions anything about working with holidays and weekends. Holidays would be harder as they are different around the world but there might be support for that already.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives