Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: DateCalc using Date::Manip

by tsdesai (Acolyte)
on Jan 10, 2017 at 11:41 UTC ( [id://1179282]=note: print w/replies, xml ) Need Help??


in reply to Re: DateCalc using Date::Manip
in thread DateCalc using Date::Manip

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

Replies are listed 'Best First'.
Re^3: DateCalc using Date::Manip
by huck (Prior) on Jan 10, 2017 at 12:00 UTC

    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,

        ok one more to try

        print Delta_Format($dtopt,'semi','+%yv:%Mv:+%wv:%dv:%hv:%mv:%sv');
        based on the code from Krambambuli above but using semi

Re^3: DateCalc using Date::Manip
by LanX (Saint) on Jan 10, 2017 at 11:43 UTC
    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
        You were using different code (this includes Delta_Format ) AND time stamps ( 04 vs 08 ) on different servers without telling us.

        The output you are showing now is also different from the original post. 3648 vs 6576

        And you have no clue what the output you are requesting means (keyword "weeks")

        In total: You are wasting our time because you are to lazy or to ignorant to ask a proper question.

        Sorry, I'm afraid I can't help you ...

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

        Update

        3648h/24 are 152 days now but the code doesn't calculate the diff between 5 month anymore... oO

        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,
        Don't you think the correct output and version number of the new server is of interest too?

        Hope it helps.

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

      I reckon its 21 months and 5 days

        It makes no sense that there would be 21 months and 5 days between two dates within the same year.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-25 16:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found