Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7442611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:12:09+00:00 2026-05-29T11:12:09+00:00

I have this routine, I want to save that delta to count the days

  • 0

I have this routine,

I want to save that delta to count the days between all to and from days in the from-to pairs
I have in the 2 dimensional array, I just need the workdays.

Say for

$date_from = 2012-02-09;
$date_to = 2012-02-13;
$delta_string = 4

sub calc_usage {
    use Date::Manip::Date;

    my $date_from;
    my $date_to;
    my $delta;

    my $i;
    for $i (0 .. $#DATE_HOLDER) {
        $date_from = new Date::Manip::Date;
        $date_to = new Date::Manip::Date;

        $date_from->parse($DATE_HOLDER[$i][0]);
        $date_to->parse($DATE_HOLDER[$i][1]);

        $delta = $date_from->calc($date_to, "business");

    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:12:10+00:00Added an answer on May 29, 2026 at 11:12 am

    To retrieve the delta values, you have to use the folllowing:

    my @val = $delta->value();
    

    wich gives an array of 7 elements where:

    $val[0]   holds years
    $val[1]   holds months
    $val[2]   holds weeks
    $val[3]   holds days
    $val[4]   holds hours
    $val[5]   holds minutes
    $val[6]   holds seconds
    

    you can also use it in scalar context:

    my $val = $delta->value();
    

    wich gives a string with the same 7 elements colon separated:

    years:months:weeks:days:hours:minutes:seconds
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this routine that works well, but it messes up as it counts
I have a routine that examines thousands of records looking for discrepancies. This can
I have this routine which is called onmouseover of a certain element. I want
I have a query that, basically, says this: SELECT DISTINCT [DB_ID] FROM [TableX] WHERE
I have an ArrayList of Routine objects and I must use this method to
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
I have this string 2012-06-27 16:17:06 and I want to convert it to GMT
I have a saving routine that should prompt the user in the following way:
I have a binary file that starts off with some data. After this data,
In my user registration routine, i have this code : @user = User.new(attribs) @user.build_inventory(:max_slots

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.