Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: DateCalc using Date::Manip

by LanX (Saint)
on Jan 10, 2017 at 11:23 UTC ( [id://1179278]=note: print w/replies, xml ) Need Help??


in reply to DateCalc using Date::Manip

Does the output you show really belong to the displayed code?

As a side note, you should tell us which versions of Date::Manip you are using.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

update
The delta of the dates is roughly 5 months or 152 days.

6576 hours are roughly 274 days

21 month + 5 days are roughly 645 days.

update

Just realising this delta format has 7 fields, tried to understand the pod and gave up.

update

Aha. .. weeks ?!

> A delta consists of 7 fields: years, months, weeks, days, hours, minutes, and seconds, usually expressed as a colon-separated string. For example:

Replies are listed 'Best First'.
Re^2: DateCalc using Date::Manip
by tsdesai (Acolyte) on Jan 10, 2017 at 11:41 UTC
    Hi, It makes sense to me what you are saying. But i guess i need to display the output in a different format so it caters for the below output
    +0:0:+21:5:1:0:0

      did you try

      my $dtopt= DateCalc($dt1,$dt2,1);
      or maybe these will work
      my $dtopt= DateCalc($dt1,$dt2,'semi');
      or
      my $dtopt= DateCalc($dt1,$dt2,'approx');

        did you try my $dtopt= DateCalc($dt1,$dt2,1); output is 0:4:4:2:0:0:0 or maybe these will work my $dtopt= DateCalc($dt1,$dt2,'semi'); 0:4:4:2:0:0:0 my $dtopt= DateCalc($dt1,$dt2,'approx'); 0:4:4:2:0:0:0 I am looking for the output as +0:0:+21:5:1:0:0 I am really sorry this is not my code.I am trying the fix old code after the version updates. Many Thanks,
      You haven't answered my questions.

      A) correct output?

      B) Version numbers

      > so it caters for the below output

      Do you even know what it means?

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

        To add to my previous reply regarding the correct output as on the old server with old version of Datemanip is +0:0:+21:5:1:0:0 With the new server and new version of Date Manip(6.14) The output which i get is below the code that i use on the new server is
        my $s1="2016040100:00:00"; my $e1="2016123100:00:00"; $dbyx1 =(DateCalc($s1, $e1)); $dbyx1 = Delta_Format($dbyx1,'0','+%yv:%Mv:+%wv:%dv:%hv:%mv:%sv'); print "\ndbyx1 = $dbyx1\n";
        Output +0:0:+0:0:3648:0:0 I hope i am being clear. Many Thanks, T
          A reply falls below the community's threshold of quality. You may see it by logging in.
        The correct output as of now on the old server is +0:0:+21:5:1:0:0 Version number for dateManip is 6.41 I hope it helps. R,
        I reckon its 21 months and 5 days

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-20 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found